Ykkrosh Posted January 5, 2010 Report Share Posted January 5, 2010 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. Quote Link to comment Share on other sites More sharing options...
janwas Posted January 6, 2010 Report Share Posted January 6, 2010 I see newer versions of boost have added fpclassify. I'm happy to use that instead - think it's worth upgrading now? Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted January 6, 2010 Author Report Share Posted January 6, 2010 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.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.