I'm using Jon Skeet's Misc Util library with Marc's Operator generic math class. I'm finding precision issues that I wouldn't otherwise find if I did the math normally.
For example, I find an error of something like .0001 when computing vector cross products compared to the regular float type operators.
Is this to be expected?
[Test]
public static void Reproduce_OperatorT_Issue()
{
float termFive = Operator<float>.Multiply(5.3f, 56.0f);
float termSix = Operator<float>.Multiply(6.5f, 55.0f);
float newZ = Operator<float>.Subtract(termFive, termSix);
Assert.AreEqual(newZ, 5.3f * 56.0f - 6.5f * 55.0f);
}
Output: Expected: -60.6999817f But was: -60.6999893f