I am having some issues related to the precision with Decimals. Let's take a look at the following scenario:
Decimal total = (5 / 3) * 3;
System.debug(total) // this will print 4.9999999999999999
total = 5 * 3 / 3;
System.debug(total) // this will print 5
theThe reason seems that in the first operation, the number that arrives at the multiplication is 1.66666666666666666 (Decimal precision)
isIs there any know bug from salesforce with this?
because Because in other languages I don't observe this is not happening
Cheersbehavior.