[Numpy-discussion] what goes wrong with cos(), sin()

David M. Cooke cookedm@physics.mcmaster...
Thu Feb 22 14:23:32 CST 2007


On Feb 21, 2007, at 14:54 , Christopher Barker wrote:

> Anne Archibald wrote:
>> Or, to see more clearly, try taking (on a pocket calculator, say)
>> sin(3.14) (or even sin(pi)).
>
> This is an interesting point. I took a class from William Kahan once
> (pass/fail, thank god!), and one question he posed to us was:
>
> How many digits of pi is used in an HP calculator?

FWIW,

There are two data types for reals (at least on the HP 28 and 48  
series, and others in that line): a 12 decimal digit real used for  
communicating with the user, and an extended 15 decimal digit real  
used internally. All calculations are done in base 10.

The exponent e for the 12-digit real is in the range -500 < e < 500,  
and for the 15-digit, -50000 < e < 50000.

AFAIK, most of HP's calculators are like this.

-- 
|>|\/|<
/------------------------------------------------------------------\
|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/
|cookedm@physics.mcmaster.ca



More information about the Numpy-discussion mailing list