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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...