[ET Trac] [Einstein Toolkit] #1650: piraha parses "-0." incorrectly
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Wed Aug 6 01:45:27 CDT 2014
#1650: piraha parses "-0." incorrectly
--------------------+-------------------------------------------------------
Reporter: rhaas | Owner:
Type: defect | Status: new
Priority: minor | Milestone:
Component: Cactus | Version: development version
Keywords: |
--------------------+-------------------------------------------------------
When encountering
foo::bar = -0.
in parameter files, the piraha parser returns (double)0. instead of
(double)-0. it is misses the signed zero that the floating point numbers
provide.
This makes it impossible to recover from (older) checkpoints where eg
coordbase::xmin is given as -0.
A possible fix is to change line 545 of Call.cc from
{{{
ret->ddata = -ret->ddata;
}}}
to
{{{
ret->ddata = std::copysign(ret->ddata, std::signbit(ret->ddata) ? 1. :
-1.);
}}}
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1650>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list