I’m trying to test a function that returns a float, the problem is that I want to put the number manually and then compare it with the return of the function, but the test always fails since the two floats are never the same. For example, the result of the function is 0.8, but if I test:
Result: = floatFun () // result = 0.8
If result == 0.8 {
…
}
The test fails, since the 0.8 I put manual becomes a 0.7999 …
How to handle the floats in order to test them?