Project

General

Profile

Actions

Bug #8894

closed

Fixnum#quo returns wrong result when given a float

Added by marcandre (Marc-Andre Lafortune) over 11 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.2
Backport:
[ruby-core:57125]

Description

Fixnum#quo is buggy.

2.quo(2.0) # => Rational(2, 2)

  1. Should return a float, not a rational
  2. Moreover, that rational is invalid as it is not reduced.

Noticed by David MacMahon [ruby-core:57121]


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #5515: Integer#quo(aFloat) の結果が Rational になるClosedmrkn (Kenta Murata)10/30/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0