www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - number not representable as a `float` in Phobos unittest

reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
Hi everybody,

I'm having that when compiling a project with unittests enabled:

```
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3791,36): Error: number `0x0.8p-126f` is not representable as a
`float`
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3791,36):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3791,75): Error: number `0x0.8p-126f` is not representable as a
`float`
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3791,75):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3793,36): Error: number `0x0.555556p-126f` is not representable as a
`float`
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3793,36):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exp
nential.d(3793,80): Error: number `0x0.555556p-126f` is not representable as a
`float`
```

I've searched a little, but I don't know if it's a known bug or 
regression.

/Paolo
Apr 30 2023
parent reply max haughton <maxhaton gmail.com> writes:
On Sunday, 30 April 2023 at 08:59:02 UTC, Paolo Invernizzi wrote:
 Hi everybody,

 I'm having that when compiling a project with unittests enabled:

 [...]
If you are on MacOS this is because of a change in the macos libc string to float functions, it's been fixed in DMD master
Apr 30 2023
parent Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Sunday, 30 April 2023 at 14:04:23 UTC, max haughton wrote:
 On Sunday, 30 April 2023 at 08:59:02 UTC, Paolo Invernizzi 
 wrote:
 Hi everybody,

 I'm having that when compiling a project with unittests 
 enabled:

 [...]
If you are on MacOS this is because of a change in the macos libc string to float functions, it's been fixed in DMD master
Thank you, good to know.
May 01 2023