#7099 closed Bugs (fixed)
boost/math/special_functions/detail/erf_inv.hpp", line 342: error: floating constant is out of range
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Boost 1.52.0 | Component: | math |
Version: | Boost 1.50.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hello,
When compiling with my TI compiler, I get this error: "boost/math/special_functions/detail/erf_inv.hpp", lines 342-345: error: floating constant is out of range.
I was able to fix this by substituting BOOST_MATH_BIG_CONSTANT with BOOST_MATH_HUGE_CONSTANT on these lines. I don't know if this is the right fix for my case, nor if this is the right fix for in general.
Regards, Kris
Change History (10)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Can you please try the change referenced above and let me know if it fixes the issue for you?
Many thanks.
comment:4 by , 10 years ago
Thanks for looking into this, John.
I've tried the change [79332]. Unfortunately it doesn't fix the problem.
Compiling a file as simple as:
#include <boost/math/special_functions/erf.hpp>
with the TI compiler results in error: "boost/math/special_functions/detail/erf_inv.hpp", lines 339-342,351,353: error: floating constant is out of range.
The errors on lines 351 and 353 look like a typo to me. On those two lines: s/BOOST_MATH_BIG_CONSTANT/BOOST_MATH_HUGE_CONSTANT
The errors on lines 339-342 seem to be reported even though this template is never instantiated. I checked this by adding BOOST_MPL_ASSERT(mpl::false_) to that function. The assertion is not reported by the compiler. Looks like the compiler reports an error when it sees a too large float constant at some early stage of compilation, even though the constant never gets used.
comment:6 by , 10 years ago
OK, I've had a second try - this time using preprocessor rather than compile time logic. Can you try this again with Trunk? Thanks!
comment:7 by , 10 years ago
Yes, this fix [79439] works for my TI compiler, thanks again for looking into this.
Here's more info about preprocessor constants in this compiler, maybe they're of some use for a more concrete fix here:
__GNUC__=3 __GNUC_MINOR__=0 LDBL_MIN_EXP=-1021 LDBL_MAX_10_EXP=308 __TI_COMPILER_VERSION__=7003006
Cheers, Kris
comment:8 by , 10 years ago
Thanks for the info: the fix should be reasonably generic so I don't think we need a compiler specific fix here - hopefully!
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 by , 10 years ago
Milestone: | To Be Determined → Boost 1.52.0 |
---|
That's not really the correct fix in general, as it breaks the test to see whether the constant has underflowed to zero or not. I'll try and find another fix.