[Issue 23846] std.math can't compile under macos rosetta

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 26 11:32:03 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23846

--- Comment #9 from kinke <kinke at gmx.net> ---
(In reply to mhh from comment #5)
> The weird thing is that it *does* return the value still, which I think the
> standard doesn't really want it to due.

Does it? DMD doesn't use the value at all, it uses the `strtold` result. It
just uses strtof/d to check for over/underflows of non-real literals.

> It isn't enough to check ERANGE - underflow can (I think it's implementation defined) trigger ERANGE but if the result is nonzero it's still supposed to be correctly rounded.

https://en.cppreference.com/w/c/string/byte/strtof says it returns HUGE_VAL
when setting ERANGE.

> I've repeated the test with a slightly modified example program

[You'd need to reset `errno` before each call for a proper test.]

--


More information about the Digitalmars-d-bugs mailing list