Jump to content

fpclassify test failure on Windows


Recommended Posts

I've added some tests and fixes for our POSIX fpclassify/isfinite/etc emulation on Windows (in lib/posix/posix.h), but it's revealed a problem I'm not sure how to fix. The tests for denormalized numbers fail, seemingly because the fpclassify implementation loads them into 80-bit FPU registers where they're no longer denormalized, so it always thinks they're normal numbers.

I don't rely on this functionality (my code only cares about finiteness), but if we claim to implement the POSIX functions then we ought to give the right answers. But I've got no idea how it should be implemented.

Link to comment
Share on other sites

Hmm, that could work - looks like it was added in Boost 1.35. But the latest stable version of Ubuntu (9.10) only has Boost 1.34, so I wouldn't want to make 1.35 a dependency :). And it looks like their implementation for Windows just calls _fpclass, which is only defined for doubles and will give incorrect results for denormal float, so it wouldn't solve the problem anyway. (glibc seems to implement fpclassify by looking at the float/double as uint32s.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...