View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Possible error in MOD function

On Fri, 22 Feb 2008 17:18:00 -0800, Peter K <Peter
wrote:

Try typing the following ...

=MOD((1/(TAN(PI()/4-ATAN(120/119)))),1)

This produces the answer 1 in Excel 2000 and Excel 2003.
I think it should be zero, because the expression before the comma in MOD
equals -239

Peter K


Actually, Excel calculates the part before the comma as:

-239.000000000001

A formula like:

=MOD(ROUND((1/(TAN(PI()/4-ATAN(120/119)))),10),1)

does return 0
--ron