Closed pascalriquier closed 3 weeks ago
Be aware, that comparing floating point numbers with equals
is a bad idea in general.
Better to use something like assertEquals(number_a, number_b, 1E-6)
with margin of tolerance to account for rounding errors.
Excuse me, I should have been more precise about that, the actual value is
-5.342751485506088923587863698926158782093908691025920000 kg/(ha·day*365²)
It is not a rounding issue.
Agreed that's definitely not what we'd expect.
@andi-huber for further clarity, we are using version 2.1.3 of indriya, do you want me to verify if the issue is also there in 2.2?
@pascalriquier yes that would be great thanks!
OK @andi-huber I see that it is fixed in 2.2, we know what to do ;-)
No longer an issue in 2.2
.
We want to do a simple addition of 2 quantities, which are in unit (kg/(ha.year.year)), see code example below. This is not giving us the correct answer, we assume due to the fact that the two numbers are converted to the system-unit, which will convert the year to seconds and then to the second power of that. Could this be handled better or could we do anything else on our side?