- changed status to open
- removed comment
piraha parses "-0." incorrectly
Issue #1650
closed
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.);
Keyword:
Comments (4)
-
-
- changed status to open
- removed comment
-
reporter - changed status to resolved
- removed comment
Fixed in flesh rev 5125.
-
reporter - edited description
- changed status to closed
- Log in to comment
Looks good.