delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/05/24/16:57:49

Date: Mon, 24 May 93 16:13:56 EDT
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: fine AT main1 DOT jinr DOT dubna DOT su
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Wrong cos() ???

> COS(X)=   7.83951354E-15   computed by IBM PC 486/25 MSDOS v.5.0 + DJGPP
>           7.34169098E-16   computed by IBM/VM
>           7.34169098E-16   computed by VAX/VMS
>       Does anybody know how could one work around this problem?

What problem?  You are approximating cos(-20.5*pi), which is zero, on machines
with different floating point hardware.  All get the "wrong" answer, but the
errors are small compared to the -1 to +1 range possible from the cos
function.  The only surprising thing is that the VAX and IBM/VM results agree.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019