Actions
Bug #21814
closed0.pow(2,-9999999999999999990) should be zero
Bug #21814:
0.pow(2,-9999999999999999990) should be zero
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) about 2 months ago
- 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) about 2 months ago
Updated by nobu (Nobuyoshi Nakada) about 2 months ago
- 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.
Updated by k0kubun (Takashi Kokubun) about 1 month ago
- Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE
ruby_4_0 893dcb5f25cbb0574ae73aa8fc926fd26750a27f merged revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326.
Updated by nagachika (Tomoyuki Chikanaga) 29 days ago
- Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE, 4.0: DONE
ruby_3_4 8fa17ea3b2c857369c808a4384ff7ff8174d69f8 merged revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326.
Actions