在 2022-06-14 16:16, [email protected] 写道:
mingw pow() is the only platform that gives '1e-9 == 10.**-9' is False in Python. It is mentioned here [1].The issue mentioned that post got an error more than one one you mentioned in this case. I think this problem is more important than the one you mentioned. llvm is also using idea of doing '1/(x^y)' in their pow() function.
Yes. Our current implementation gives an error of more than 4 ULPs:
```
#include <quadmath.h>
#include <math.h>
#include <stdio.h>
int
main(void)
{
char temp[50];
volatile double comp = 1.0e-9;
volatile double ten = 10;
printf("comp = %a\n", comp);
printf("pow = %a\n", pow(ten, -9));
quadmath_snprintf(temp, sizeof temp, "%Qa", powq(ten, -9));
printf("powq = %s\n", temp);
}
```
gives:
```
comp = 0x1.12e0be826d695p-30
pow = 0x1.12e0be826d699p-30
powq = 0x1.12e0be826d694b2e62d01511f12ap-30
```
which is absolutely not desired.
--
Best regards,
LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
