Re: [AD] C++ fix math

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> This looks fine to me. Whilst we're at it, can we add a quick function
> to convert to/from radians? Perhaps something like this:
>
> fixed radtofix(fixed f) { return fixmul(f, (fixed)2670177) & 0xFFFF; }
> fixed fixtorad(fixed f) { return fixmul(f, (fixed)1608); }

Given that the trigonometric functions for the 'fixed' type never deal with
radians, these are not IMHO the most useful ones. What about

    fixed radtofix(float x);
    float fixtorad(fixed x);

instead ?

- Eric



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/