Project

General

Profile

Actions

Bug #21814

closed

0.pow(2,-9999999999999999990) should be zero

Bug #21814: 0.pow(2,-9999999999999999990) should be zero

Added by matz (Yukihiro Matsumoto) 3 days ago. Updated 3 days ago.

Status:
Closed
Assignee:
-
Target version:
[ruby-core:124388]

Description

When I try 0.pow(2,-9999999999999999990), irb prints -9999999999999999990, but I think no matter what you divide zero by, the modulo should be zero.

Matz.

Updated by nobu (Nobuyoshi Nakada) 3 days ago Actions #1

  • Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED

Updated by nobu (Nobuyoshi Nakada) 3 days ago Actions #3

  • Status changed from Open to Closed

Applied in changeset git|19e539c9ee1701b34189fa0c1feb942adeb0e326.


[Bug #21814] Fix negative bignum modulo

If modulo is zero, do not apply bias even if the divisor is zero.
BIGNUM_POSITIVE_P is true even on bignum zero.

Actions

Also available in: PDF Atom