(In reply to André Bargull [:anba] from comment #7) > (In reply to sanketh from comment #1) > > I don't think that would resolve the issue. In math libraries, for uniformity we want to use 64bit doubles on all systems---on some systems a `double` might be 32bit---which we why we define a separate `double_t`. > > There is some misunderstanding here, `double` is always 64-bit, whereas `long double` is at least 64-bit. See also <https://en.cppreference.com/w/cpp/language/types#Floating-point_types> and <https://en.cppreference.com/w/cpp/types/climits/FLT_EVAL_METHOD>. Hmm, interesting, *why* glibc is doing then. 🤔 On 32-bit x86, unless explicitly overridden by someone setting `__FLT_EVAL_METHOD__`, [it sets `__GLIBC_FLT_EVAL_METHOD=2`](https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86/bits/flt-eval-method.h#L32) and that setting [causes `double_t = long double`](https://github.com/bminor/glibc/blob/42d359350510506b87101cf77202fefcbfc790cb/math/math.h#L154-L192). I am really confused now. I don't have access to a 32-bit linux distro right now but I'd be curious to know what `sizeof(double)` and `sizeof(long double)` return. (fwiw, on 32-bit and 64-bit Windows, they both return `8`, and on 64-bit linux `sizeof(double) = 8` and `sizeof(long double) = 16`).
Bug 1729459 Comment 9 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to André Bargull [:anba] from comment #7) > (In reply to sanketh from comment #1) > > I don't think that would resolve the issue. In math libraries, for uniformity we want to use 64bit doubles on all systems---on some systems a `double` might be 32bit---which we why we define a separate `double_t`. > > There is some misunderstanding here, `double` is always 64-bit, whereas `long double` is at least 64-bit. See also <https://en.cppreference.com/w/cpp/language/types#Floating-point_types> and <https://en.cppreference.com/w/cpp/types/climits/FLT_EVAL_METHOD>. Hmm, interesting, *why* glibc is doing then. 🤔 On 32-bit x86, unless explicitly overridden by someone setting `__FLT_EVAL_METHOD__`, [it sets `__GLIBC_FLT_EVAL_METHOD=2`](https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/x86/bits/flt-eval-method.h#L32) and that setting [causes `double_t = long double`](https://github.com/bminor/glibc/blob/42d359350510506b87101cf77202fefcbfc790cb/math/math.h#L154-L192) in `math.h`. I am really confused now. I don't have access to a 32-bit linux distro right now but I'd be curious to know what `sizeof(double)` and `sizeof(long double)` return. (fwiw, on 32-bit and 64-bit Windows, they both return `8`, and on 64-bit linux `sizeof(double) = 8` and `sizeof(long double) = 16` (I got these numbers from the [Compiler Explorer](https://godbolt.org/))).