Avatar
omochimetaru 4/2/2018 10:29 AM
FloatとDoubleは2進数なので 9.95 は正しく扱えないので、 10進少数のDecimal型を使うのが良いです https://developer.apple.com/documentation/foundation/decimal (edited)
10:30 AM
@swiftbot
10:30 AM
@swiftbot import Foundation let a = Decimal(string: "9.95")! * Decimal(string: "100")! print(Decimal(string: "995")! == a)