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 #2

Updated by mame (Yusuke Endoh) 8 months ago

  • Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED

Updated by mame (Yusuke Endoh) 8 months ago

Fortunately, this bug was introduced this year on da39936ce165ea9462b9e192eb6b608485c94842 so no need to backport.

Actions #4

Updated by mame (Yusuke Endoh) 8 months ago

  • Status changed from Open to Closed

Applied in changeset git|411572661a3995a0daacb6c866ea3ac6b52ad25b.


math.c: Fix Math.log against huge bignum [Bug #19878]

Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0