We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
log10(1000); #3 (Rat)
log10(1000); #2.9999999999999996 (Num)
raku is proud to handle decimals (and other rationals) in a way that avoids irrational results (geddit?)
python handles this "right" https://gist.github.com/librasteve/fc2999c28654d219876c537abf554524
so does C https://www.netlib.org/fdlibm/e_log10.c
looks like this:
MoarVM/src/core/interp.c
Line 967 in 75fe055
could maybe add new OP something like this:
OP(log10_n): { MVMnum64 x = GET_REG(cur_op, 2).n64; GET_REG(cur_op, 0).n64 = #ifdef MVM_HAS_SUBSTANDARD_LOG x < 0 ? MVM_num_nan(tc) : #endif log10(x); cur_op += 4; goto NEXT; }
The text was updated successfully, but these errors were encountered:
@librasteve have you tried log(1000, 10) ?
log(1000, 10)
Sorry, something went wrong.
[3] > log(1000,10) #2.9999999999999996
same problem
No branches or pull requests
Expected Behaviour
log10(1000); #3 (Rat)
Actual Behaviour
log10(1000); #2.9999999999999996 (Num)
Rationale
raku is proud to handle decimals (and other rationals) in a way that avoids irrational results (geddit?)
python handles this "right"
https://gist.github.com/librasteve/fc2999c28654d219876c537abf554524
so does C
https://www.netlib.org/fdlibm/e_log10.c
Change Needed
looks like this:
MoarVM/src/core/interp.c
Line 967 in 75fe055
could maybe add new OP something like this:
The text was updated successfully, but these errors were encountered: