Sum/sub decimals operation bug

Description

The result of operation (+ 0.7 0.1) is 0.7999999999999999 and not 0.7

Other operations with the same behaviour:
(+ 0.11 0.1) => 0.21000000000000002
(+ 0.31 0.1) => 0.41000000000000003
(- 0.8 0.1) => 0.7000000000000001
(- 0.41 0.1) => 0.30999999999999994

Environment

None

Activity

Show:
import
October 15, 2014, 12:44 PM

Comment made by: ocharles

Uh, isn't this just normal floating point arithmetic?

import
October 15, 2014, 1:32 PM

Comment made by: luca.gugole

But the result of other operations ((+ 0.1 0.1), (+ 0.2 0.2), (+ 0.2 0.3) ...) has only one decimal place.
It's normal?
I have to perform a math round operation to obtain only one decimal place?

Jozef Wagner
October 15, 2014, 1:41 PM
import
October 15, 2014, 1:51 PM

Comment made by: luca.gugole

Sorry about my lack of knowledge on this subject.
Thank you for the answer.

Declined

Assignee

Unassigned

Reporter

import

Labels

Approval

None

Patch

Code

Affects versions

Priority

Critical