Those constants aren't accurate to the limit of a float.  E.g.,
(float)M_PI/2.0 == 1.57079637f but (float)M_PI/2.0 != 1.5707964f.
Eight digits should be enough.

It'd be nicer to combine all the 128.0f and M_PI into one constant.
E.e. RAD_TO_BRAD (float)(128.0 * M_PI).  Binary radians or binary
degrees is what these units get called.

Even better, make an inline function to handle all the cases instead
of repeating the code.

I've got to wonder why some are offset by -90 degrees and some aren't?

On Fri, Apr 14, 2017 at 10:43 AM, Michael Bax
<mrbax.nospam.2007 at> wrote:
> Hi James
>>> substituted M_PI since it was used elsewhere
>> M_PI on my systems is a double literal, so this will promote the other
>> arguments to double, then another conversion to float before passing
>> to nearbyintf, right?
> Indeed!  Good catch.
> Cheers
> Michael
> _______________________________________________
> netrek-dev mailing list
> netrek-dev at