-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Natural logarithm (log) seems broken #202
Comments
caveat: log is broken (WebAssembly/wasi-libc#202)
Just for the record, I tried to reproduce this with https://webassembly.sh:
And there it produces the correct result. |
I don't have a |
Compiled as
(Yes, I know about |
Oops, I found my error. The file |
printf("%f ---> %f\n", 7.4225, log(7.4225));
will output7.422500 ---> inf
,whereas
printf("%f ---> %f\n", 7.4225, log10(7.4225));
gives7.422500 ---> 0.870550
, which looks like the correct answer.printf("%f ---> %f\n", 7.4225, log2(7.4225));
gives7.422500 ---> -nan
, which looks wrong too.I didn't try the
*f
and*l
versions of these.My compiler is
clang-10
fromnixpkgs
, which is version10.0.0
.The text was updated successfully, but these errors were encountered: