Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7099 closed Bugs (fixed)

boost/math/special_functions/detail/erf_inv.hpp", line 342: error: floating constant is out of range

Reported by: 1czajnik@… 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 anonymous, 10 years ago

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.

comment:2 by John Maddock, 10 years ago

(In [79332]) Tentative fix for compilers that treat floating point constants smaller than a 64-bit double can hold as hard errors. Refs #7099.

comment:3 by John Maddock, 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 1czajnik@…, 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:5 by John Maddock, 10 years ago

(In [79439]) Tentative fix #2 for TI compiler error. Refs #7099.

comment:6 by anonymous, 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 1czajnik@…, 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 John Maddock, 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 John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [79444]) Document #7099 as fixed. Fixes #7099.

comment:10 by John Maddock, 10 years ago

Milestone: To Be DeterminedBoost 1.52.0
Note: See TracTickets for help on using tickets.