Re: [Mingw-w64-public] fix pow() floating point imprecision

2022-06-07 Thread LIU Hao
在 2022/6/7 17:11, g...@m-labs.hk 写道: Attached is a patch to fix that. The approach looks credible. However: The proposed solution transforms calculation of `pow(x, y)`, where `y` is negative, into `1 / pow(x, -y)`. This is not strictly equivalent. The maximum value that a `double` may repre

[Mingw-w64-public] fix pow() floating point imprecision

2022-06-07 Thread gw
Dear Sir/Madam, As mentioned in here, there is a floating point imprecision problem in the pow function. Originally, #include #include int main() { union { double d; unsigned long long int i; } cast; cast.d = pow(10., -9); printf("%llx\n", cast.i); return 0; } 3e112e0be826d699 the probl