On Mon, Sep 20, 2010 at 09:03:03AM +0200, Per Inge Mathisen wrote: > On Mon, Sep 20, 2010 at 1:42 AM, Giel van Schijndel <[email protected]> wrote: >> Moreover, *why* does it need to be in fixed point? > > Did you miss all of the discussion about how the FPU rounds > differently on some platforms in some cases? We need fixed point to > get determinism. Epsilons do not help.
No, I missed most of it (was writing my thesis at the time). Either way, knowing that epsilons don't help answers my question about why they're needed. Was epsilon smaller on some platforms than others? I.e. was the difference in the size of epsilon across platforms the problem? -- That still leaves my other remark though: fixed-point math is difficult to do right (every time), I thus think we should confine the *actual* fixed point math to a very small portion of the code. IMO preferrably by using operator overloading. Also fixed point math is rather bad at MUL and DIV. I.e. especially geometric transformations (rotations and such) where you may need to multiply with cos/sin ranging anywhere from 1 to 1E-20. In my experience you use fixed point when you want to preserve precision across ADDs and SUBs but use floats for MULs and SUBs. Where fixed point is defined as an integer multiplied by a constant (usually power-of-two) to add precision and floating point defined as two integers, one the "mantissa", the other the "exponent". The difference between these two is that for fixed point math the exponent is constant, while for floating point it is not. That varying exponent is required to preserve precision across very large and small MULs and DIVs. -- Giel -- "Programming is like sex. One mistake and you have to support it for the rest of your life." -- Michael Sinz
signature.asc
Description: Digital signature
_______________________________________________ Warzone-dev mailing list [email protected] https://mail.gna.org/listinfo/warzone-dev
