Project

General

Profile

Actions

Bug #19878

closed

Math.log is broken for bignum

Added by mame (Yusuke Endoh) 8 months ago. Updated 8 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-09-04T01:35:26Z master 2ac3e9abe9) [x86_64-linux]
[ruby-core:114725]

Description

p Math.log(2 ** 1020, 10) #=> 307.0505955772608
p Math.log(2 ** 1021, 10) #=> 307.35162557292483
p Math.log(2 ** 1022, 10) #=> 307.6526555685888
p Math.log(2 ** 1023, 10) #=> 688.6994720982339 <- WHAT!?
p Math.log(2 ** 1024, 10) #=> 689.3926192787939
p Math.log(2 ** 1025, 10) #=> 690.0857664593537
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0