comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: WRONG RESULTS WITH IDL
items: Re: WRONG RESULTS WITH IDL

WRONG RESULTS WITH IDL
type: item
description: Hi Folks For calculation of beam-propagation I use IDL. But now I realize that for large arguments, even with double-precision, IDL gives wrong results: For example: sin(12345678901.12345678901) = -03727 9004 9960 8007 where IDL get: IDL> x = double(12345678901.12345678901) IDL> print, sin(x) 0.098761418 Can somebody confirm this result, and does anybody know the solution to overcome this problem? Best regards Frank
creator: loewenthal
date: 1998-05-05T07:00:00-00:00

Re: WRONG RESULTS WITH IDL
type: item
description: Frank Loewenthal wrote in message <354ef5cc.356842983@news>... > Hi Folks > > For calculation of beam-propagation I use IDL. But now I realize that > for large arguments, even with double-precision, IDL gives wrong > results: > For example: > > sin(12345678901.12345678901) = -03727 9004 9960 8007 > > where IDL get: > > IDL> x = double(12345678901.12345678901) > IDL> print, sin(x) > 0.098761418 > > Can somebody confirm this result, and does anybody know the solution > to overcome this problem? ################################################ You are not using double. Try it this way: (Note the d for double) print,sin(12345678901.12345678901d) Anders Johannesson ################################################# > > Best regards > > Frank
creator: Anders Johannesson
date: 1998-05-14T07:00:00-00:00