Thread overview
number not representable as a `float` in Phobos unittest
Apr 30, 2023
Paolo Invernizzi
Apr 30, 2023
max haughton
May 01, 2023
Paolo Invernizzi
April 30, 2023
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/exponential.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/exponential.d(3791,36):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exponential.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/exponential.d(3791,75):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exponential.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/exponential.d(3793,36):        https://dlang.org/spec/lex.html#floatliteral
/Users/pinver/dlang/dmd-2.103.0/osx/bin/../../src/phobos/std/math/exponential.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

April 30, 2023
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
May 01, 2023
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.