Calculating Cos(pi() / 2) in Excel (?)

C

Charlie Johnson

When I try to compute the cos(pi()/2) , I keep getting 6.12574E-17. Does
that mean 0? I know from computer programming that something that small is
essentially 0. Is that how Excel represents 0? If so, I would have thought
MS could have programmed that into Excel.

Lurch
 
D

Dave Peterson

See one response to your other post.

Charlie said:
When I try to compute the cos(pi()/2) , I keep getting 6.12574E-17. Does
that mean 0? I know from computer programming that something that small is
essentially 0. Is that how Excel represents 0? If so, I would have thought
MS could have programmed that into Excel.

Lurch
 
D

David

Charlie

The problem is not really with the zero, but the fact that PI/2 is not
exact. As you know PI is an infinitely long non-recurring number. This is
true in decimal and binary (and in any number system).

So even if arguments to functions are given to 64 bits, the value stored for
PI/2 will not be PI/2 but something very close to this. Thus the cosine of
this will not be zero, but something quite close to it. 6 x 10^-17 would be
close enough for me!

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top