Boost C++ Libraries: Ticket #7099: boost/math/special_functions/detail/erf_inv.hpp", line 342: error: floating constant is out of range https://svn.boost.org/trac10/ticket/7099 <p> Hello, </p> <p> 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. </p> <p> 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. </p> <p> Regards, Kris </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7099 Trac 1.4.3 anonymous Fri, 06 Jul 2012 16:23:14 GMT <link>https://svn.boost.org/trac10/ticket/7099#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:1</guid> <description> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 07 Jul 2012 11:18:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79332" title="Tentative fix for compilers that treat floating point constants ...">[79332]</a>) Tentative fix for compilers that treat floating point constants smaller than a 64-bit double can hold as hard errors. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7099" title="#7099: Bugs: boost/math/special_functions/detail/erf_inv.hpp&#34;, line 342: error: ... (closed: fixed)">#7099</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 07 Jul 2012 11:19:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:3</guid> <description> <p> Can you please try the change referenced above and let me know if it fixes the issue for you? </p> <p> Many thanks. </p> </description> <category>Ticket</category> </item> <item> <author>1czajnik@…</author> <pubDate>Mon, 09 Jul 2012 08:49:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:4</guid> <description> <p> Thanks for looking into this, John. </p> <p> I've tried the change <a class="changeset" href="https://svn.boost.org/trac10/changeset/79332" title="Tentative fix for compilers that treat floating point constants ...">[79332]</a>. Unfortunately it doesn't fix the problem. </p> <p> Compiling a file as simple as: </p> <pre class="wiki">#include &lt;boost/math/special_functions/erf.hpp&gt; </pre><p> 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. </p> <p> 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 </p> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 12 Jul 2012 09:53:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79439" title="Tentative fix #2 for TI compiler error. Refs #7099.">[79439]</a>) Tentative fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2" title="#2: Bugs: list::size should be const (closed: fixed)">#2</a> for TI compiler error. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7099" title="#7099: Bugs: boost/math/special_functions/detail/erf_inv.hpp&#34;, line 342: error: ... (closed: fixed)">#7099</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 12 Jul 2012 09:54:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:6</guid> <description> <p> OK, I've had a second try - this time using preprocessor rather than compile time logic. Can you try this again with Trunk? Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>1czajnik@…</author> <pubDate>Thu, 12 Jul 2012 11:07:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:7</guid> <description> <p> Yes, this fix <a class="changeset" href="https://svn.boost.org/trac10/changeset/79439" title="Tentative fix #2 for TI compiler error. Refs #7099.">[79439]</a> works for my TI compiler, thanks again for looking into this. </p> <p> Here's more info about preprocessor constants in this compiler, maybe they're of some use for a more concrete fix here: </p> <pre class="wiki">__GNUC__=3 __GNUC_MINOR__=0 LDBL_MIN_EXP=-1021 LDBL_MAX_10_EXP=308 __TI_COMPILER_VERSION__=7003006 </pre><p> Cheers, Kris </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 12 Jul 2012 11:15:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7099#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7099#comment:8</guid> <description> <p> Thanks for the info: the fix should be reasonably generic so I don't think we need a compiler specific fix here - hopefully! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 12 Jul 2012 11:20:07 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7099#comment:9 https://svn.boost.org/trac10/ticket/7099#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79444" title="Document #7099 as fixed. Fixes #7099.">[79444]</a>) Document <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7099" title="#7099: Bugs: boost/math/special_functions/detail/erf_inv.hpp&#34;, line 342: error: ... (closed: fixed)">#7099</a> as fixed. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7099" title="#7099: Bugs: boost/math/special_functions/detail/erf_inv.hpp&#34;, line 342: error: ... (closed: fixed)">#7099</a>. </p> Ticket John Maddock Thu, 02 Aug 2012 12:00:46 GMT milestone changed https://svn.boost.org/trac10/ticket/7099#comment:10 https://svn.boost.org/trac10/ticket/7099#comment:10 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.52.0</span> </li> </ul> Ticket