Forum Academy Marketplace Showcase Pricing Features

Workflow calculation problems

Hello World!
My app has a workflow that calculate, Input P - Input V, Input P value is constant 1. Input R varies from 0 top 0,99. When i calculate Input P (1) - Input V(0,32), the result should be 0,68, right? Actually this works fine for all others, but in this case the result is:
image
As you can see here:
image
image
The values used in this calculations are not wrong, but the answer is. This change the whole price of my invoice.
What can I do to solve this?
And what is the problem that causes this.

Thank you all!

I just ran this on my desktop in Node:

> const a = 1.0
1
> const b = 0.32
0.32
> a-b
0.6799999999999999

What you have unfortunately stumbled on is one of many corner cases in floating point errors. It is something we all have to live with as long as we use binary representations of floating point types. And then there the epic XKCD trolling of computer scientists: