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

Home » Public Forums » archive » Re: Can someone please explain this to me, I am stumped (or stupid)...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Can someone please explain this to me, I am stumped (or stupid)... [message #47534] Sun, 12 February 2006 19:35
David Green is currently offline  David Green
Messages: 7
Registered: July 2005
Junior Member
ahh, thankyou for the explaination. My code is now working :)

Dave.
Re: Can someone please explain this to me, I am stumped (or stupid)... [message #47535 is a reply to message #47534] Sun, 12 February 2006 19:18 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Check this out:
>
> IDL> a=1.9999999
> IDL> print, a
> 2.00000
> IDL> print, findgen(a)
> 0.000000

Whoops! I accidentally left out the last example:

IDL> print, fix(a)
1

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Can someone please explain this to me, I am stumped (or stupid)... [message #47536 is a reply to message #47535] Sun, 12 February 2006 19:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Green writes:

> This seems to be the cause of the problem, not sure why this is
> happening though
>
> IDL> print, nph[jj]
> 2.00000
> IDL> print, fix(nph[jj])
> 1
> IDL>

When is the last time you read the Sky is Falling article?

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

Check this out:

IDL> a=1.9999999
IDL> print, a
2.00000
IDL> print, findgen(a)
0.000000

Computers, man! Who needs 'em! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Can someone please explain this to me, I am stumped (or stupid)... [message #47537 is a reply to message #47536] Sun, 12 February 2006 18:20 Go to previous message
David Green is currently offline  David Green
Messages: 7
Registered: July 2005
Junior Member
This seems to be the cause of the problem, not sure why this is
happening though

IDL> print, nph[jj]
2.00000
IDL> print, fix(nph[jj])
1
IDL>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Can someone please explain this to me, I am stumped (or stupid)...
Next Topic: How to make major tick marks appear where you want them??

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

Current Time: Sat Oct 11 09:23:16 PDT 2025

Total time taken to generate the page: 1.35908 seconds