Re: [AD] About the fixed type (continued)

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


> OK, patch attached (for C only). It includes declaration in 'fixed.h'
> (the single typedef was looking a bit lonely), definition in 'math.c',
> and documentation under fixed point trig.

Fine.

> I chose the names fixtorad_r and radtofix_r, representing fixed
> point->radian ratio and radian->fixed point ratio respectively.

Ok for the names, but not for the values because...

> +@@extern const fixed @fixtorad_r;
> +@xref fixmul, radtofix_r
> +   This constant gives a ratio which can be used to convert a number in
> +   radians to a number in fixed point angle format: if 'x' is a float
> +   in radians, then use: 'y = fixmul(ftofix(x), fixtorad_r);'.

That's confusing: to convert from rad to fix, you're using fixtorad_r. I'd
rather read:
    y = fixmul(x, radtofix_r);  x in rad, y in fp angle



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