TIL about floating point math: float w=a*b; float e=fma(-a,b,w); w is the closes...

@demofox@mastodon.gamedev.place

TIL about floating point math:

float w=a*b;
float e=fma(-a,b,w);

w is the closest float possible to the real answer of a*b, but the difference between that and the actual answer can be significant.

e is that difference, and apparently the difference is exactly representable as a float.