<None>

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Oct 24 06:56:15 AEST 1990


In article <4035 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
  [ on controlling round-off errors ]
> 	double degrees(int Degrees, int Minutes, int Seconds)
> 		return ((Degrees*60.0 + Minutes)*60.0 + Seconds)/3600.0;

Some machines (e.g., Convex) have a 64-bit integer, the ``long long''
type. It's better to do the base conversion in that than in 48-bit
floating point.

> It's best to read them as
>     integers.

It's best to stick to integers entirely, if there's no worry of
overflow.

---Dan



More information about the Comp.lang.c mailing list