On Thursday, 12 December 2019 at 19:21:22 UTC, berni44 wrote:
Is it possible to get to the bits of a float in CTFE? I tried
the following, but this doesn't work:
```
import std.stdio;
union FloatBits
{
float floatValue;
ulong ulongValue;
}
ulong test(float f)
{
FloatBits fb;
f
Is it possible to get to the bits of a float in CTFE? I tried the
following, but this doesn't work:
```
import std.stdio;
union FloatBits
{
float floatValue;
ulong ulongValue;
}
ulong test(float f)
{
FloatBits fb;
fb.floatValue = f;
return fb.ulongValue;
}
void main()
{
On Thursday, 12 December 2019 at 06:23:31 UTC, Basile B. wrote:
Still worth opening an issue.
https://issues.dlang.org/show_bug.cgi?id=20443
Thanks, Basile. I've added additional information from the github
thread where the sumtype author helpfully looked into the problem.