Truncating float/doubles for reproducibility
I'm not expert in this but as far as I know the proper way to test for equality modulo floating point imprecision is to compare the differences of the two values, i.e. instead of:

trunc(a) == trunc(b) 


one would do:

abs(a-b) &lt;= epsilon


where epsilon is the constant which represents an acceptable difference, e.g. $10^{-6}$. Of course this requires to read the two values and calculate the difference, instead of simply comparing one against the other.