> Dik T. Winter wrote: ....
>
> FWIW: My old TI-34 gives me 0 even in scientific notation, regardless of
> how I enter (k+1/2)*pi for reasonably small integers k, as long as I
> keep the input rounded to the nearest decimal fraction within precision
> (which is 12 digits at 10 displayed).
In that case your old TI-34 probably does a range reduction with a pi in
about the precision. This is an old trick to make the cosine function
look good to the layman (or even some experts). Your old TI-34 is not
calculating cos(x) but cos(a * x) for some a close to 1. Given enough
data points it is possible to determine quite a lot about bad algorithms
used. Like the value of pi (or 1/pi) used in range reduction. I know
of quite a few algorithms where the argument is multiplied first by 2/pi
(in machine precision) which is followed by a much simplified range
reduction (which now amounts to taking the fractional part).
Such functions will be quite a bit wrong, especially for large values of
the argument. One of the reasons I insisted on a two-argument sine and
cosine in the Ada standard alongside to the one-argument functions. The
first argument is just the same, the second argument gives how to measure.
So sin(x, 360) gives the sine when x is in degrees, sin(x, 2 * pi) would
give the standard sine with a rounded value of pi. And sin(x) would
give the standard sine with an unrounded value of pi. The major reason
for that is that in numerical mathematics the most common expression used
is sin(2 * pi * x) with bad results, and which translates to the two
argument expression sin(x, 1.0) with good results.