Modify

Ticket #7099 (closed Bugs: fixed)

Opened 22 months ago

Last modified 21 months ago

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

Reported by: 1czajnik@… Owned by: johnmaddock
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

Attachments

Change History

comment:1 Changed 22 months ago by anonymous

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 Changed 22 months ago by johnmaddock

(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 Changed 22 months ago by johnmaddock

Can you please try the change referenced above and let me know if it fixes the issue for you?

Many thanks.

comment:4 Changed 22 months ago by 1czajnik@…

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 Changed 22 months ago by johnmaddock

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

comment:6 Changed 22 months ago by anonymous

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 Changed 22 months ago by 1czajnik@…

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 Changed 22 months ago by johnmaddock

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 Changed 22 months ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:10 Changed 21 months ago by johnmaddock

  • Milestone changed from To Be Determined to Boost 1.52.0
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.