Bug 10860 – [CTFE] Static assert real.min_normal*real.max > 2 is false in some context
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-20T11:30:00Z
Last change time
2015-06-09T01:31:21Z
Keywords
CTFE
Assigned to
nobody
Creator
maxim
Comments
Comment #0 by maxim — 2013-08-20T11:30:29Z
Considering the code from https://github.com/D-Programming-Language/phobos/blob/master/std/math.d#L2894
void main()
{
static assert(real.min_normal*real.max > 2);
}
This runs fine, but when dmd is executed under valgrind expression real.min_normal*real.max is evaluated to -nanL and assertion fails. It may happen due to different FPU environment, some bug in ctfe, flawed assertion, or combination of thereof.
Comment #1 by clugdbug — 2013-08-21T00:27:30Z
This is a valgrind problem. Valgrind doesn't implement 80-bit floating point numbers, unfortunately.