
26 Nov
2012
26 Nov
'12
1:42 p.m.
I'm wandering if this is to be expected, the following code fails if compiled with --fast-math:
//==================================================== #include <boost/math/special_functions/fpclassify.hpp> int main() { const float a = 0.0f/0.0f; assert(not boost::math::isfinite(a)); }
Which fails - does the 0/0 actually yield an infinity? Or is it isfinite that fails?
Either way is hard to make guarentees once you enable an option like that.
The following code:
[snip]
so I believe somehow even with --fast-math it should be possible to make it "working" (if it has to be).
rtfm: you asked the compiler to assume that neither arguments nor results are NaNs or Infs. if your code uses or generates NaNs or Infs its behavior is undefined.