From: andrew@... Date: 2014-04-01T18:26:10+00:00 Subject: [ruby-core:61802] [ruby-trunk - Bug #9691] Wrong value on float Issue #9691 has been updated by Andrew Vit. Use Fixnum (14995 * 100) or BigDecimal: ~~~ require 'bigdecimal' d = BigDecimal.new('149.95') d * 100 # => 0.14995E5 ~~~ More info on floating point vs. decimal numbers: http://www.youtube.com/watch?v=PZRI1IfStY0 ---------------------------------------- Bug #9691: Wrong value on float https://bugs.ruby-lang.org/issues/9691#change-46037 * Author: Mattias Bodlund * Status: Rejected * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: 2.1.0 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- Getting strange value on multiplying a float 149.95 * 100 => 14994.999999999998 -- https://bugs.ruby-lang.org/