Project

General

Profile

This project is closed and read-only.

Actions

Feature #3894

closed

Bug in the method Float and/or puts

Feature #3894: Bug in the method Float and/or puts

Added by karfter (Karfter ERE) almost 16 years ago. Updated over 15 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:32660]

Description

=begin
The bug is a problem in displaying a float, which can cause errors in calculating!!

example:

#ruby1.9.2 or ruby1.9.1 or ruby1.8.7
puts 2305843008139952128.0/23427.0

!= 98426730189096.005805267"

#Display 98426730189096.0 instead of 98426730189096.005805267
#This bug affects all versions, whatever the system x86 or x86_64 Linux

#Another error
puts 10.0/3.0
#ruby1.9.1 or ruby1.8.7
#good infinity
#3.33333333333333
#ruby1.9.2
#bad infinity
#3.3333333333333335

#ruby1.9.1 or ruby1.8.7
#good
puts 23427.0/17.0
#1378.05882352941
#ruby1.9.2
#No check, looks good!?
#1378.0588235294117
=end


Related issues 1 (0 open1 closed)

Related to Ruby - Bug #3746: Incorrect Float subtractionRejectedActions

Updated by nobu (Nobuyoshi Nakada) almost 16 years ago Actions #1

  • Status changed from Open to Rejected

=begin
Floating point has a different arithmetic and is a inexact number.
So you should know its esoteric system. see following:

=end

Actions

Also available in: PDF Atom