comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: mathematics-accuracy
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: mathematics-accuracy [message #51378] Wed, 15 November 2006 13:43
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
creon writes:

> Hello. I've been having a problem on math operations with floating
> point numbers. I'll be thankful if you help me out with this.
> Now, I have a series of floating-point numbers - str={arr:findgen(x)},
> codes.... the first element of the series is 1.20740. i need to get the
> square of this, which is 1.45781. when i type
> print, str.arr[0]^2
> it returns 1.45780. i tried setting the data types to double - with
> dindgen-, and had 1.45783. I don't know what the problem is, and how i
> can fix it. please help. thanks.

I think you can fix most of your problems by reading this
article, especially the section in the middle about how
PRINT works:

http://www.dfanning.com/math_tips/sky_is_falling.html

Cheers,

David

P.S. Hint, use the FORMAT keyword.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: mathematics-accuracy
Next Topic: Re: I found one thing!!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:29:33 PDT 2025

Total time taken to generate the page: 0.00378 seconds