Hello,

I have a system which calculates a final value from the sum of several

different variables by adding the values of those variables together.

First, the variables must be multiplied by a percentage, in this case represented by a value between 0 and 1, with 0.00 being 0% and 1.00 being 100%:

```
<<set $VariableDifference1 to 0>>
<<set $MainValue to 100>>
<<set $PercentageValue to 0.056>>
$VariableDifference1
$MainValue
$PercentageValue
<<set $VariableDifference1 to $MainValue * $PercentageValue>>\
$VariableDifference1
$MainValue
$PercentageValue
```

And in this case, as you can see if you try it for yourselves,

$variableDifference1 becomes 5.6000000000000005 rather than 5.6. Due to

the nature of the system I am creating, answers regarding percentages etc

would need to be as precise and exact as possible. I am also unsure if

the actual addition side is correct or not, it only uses a fairly simple

`<<set $x3 to $x1 + $x2>>`

Type thing, but I know that the end result is often incorrect because to

multiply a number by a percentage I personally can't think of any way

other than multiplying it by a number with a decimal place, and I've had

this explained to me only recently by MadExile, but because of the way

the system performs calculation, it will sometimes return numbers with

multiple decimal places even if it's adding/multiplying two whole numbers

together.

To summarise, I'm in need of a method that could calculate the percentage

of a value as exactly as possible with as little margin for error as

possible. Thank you.

Much Obliged greyelf; so far so good! I wasn't at all aware that the number next to the 'e' represented how many digits would be translated to whole numbers. Interesting. Even so, I'm still slightly concerned that if, for example, I add two separate numbers from these calculations with the standard macros;

(As of me writing this post, the code format button isn't currently in the toolbar in it's regular place, nor can I see it elsewhere for whatever reason.)

<<set $x3 to $x1 + $x2>>

The above could still have a chance of generating a resulting answer that could be mathematically incorrect. Is there any way to address this issue, or to place some kind of code that calculates sums as a calculator would rather than with the standard multiple floating points etc?