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

Home » Public Forums » archive » bug in plotting with large long integers
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
bug in plotting with large long integers [message #14689] Tue, 23 March 1999 00:00 Go to next message
David Ritscher is currently offline  David Ritscher
Messages: 30
Registered: August 1995
Member
I just came across an interesting bug in IDL and PV-Wave:

plot, /ynozero, lindgen(2000) + long(1e9)

It seems to be thrown off by numeric problems, resulting in a staircase
instead of a straight line.


David Ritscher



--
Cardiac Rhythm Management Laboratory
Department of Medicine
University of Alabama at Birmingham
B168 Volker Hall - 1670 University Boulevard
Birmingham AL 35294-0019
Tel: (205) 975-2122 Fax: (205) 975-4720
Re: bug in plotting with large long integers [message #14773 is a reply to message #14689] Wed, 24 March 1999 00:00 Go to previous message
Axel vom Endt is currently offline  Axel vom Endt
Messages: 9
Registered: March 1999
Junior Member
David Ritscher wrote:
>
> I just came across an interesting bug in IDL and PV-Wave:
>
> plot, /ynozero, lindgen(2000) + long(1e9)
>
> It seems to be thrown off by numeric problems, resulting in a staircase
> instead of a straight line.
>
> David Ritscher

Yes, but this behaviour is documented in the online help of PLOT:

"This argument is converted to single-precision floating-point before
plotting. Plots created with PLOT are limited to the range and precision
of single-precision floating-point values."

Your long(1e9) is converted to float. Try

IDL> print, float(long(1e9) + 1L) - long(1e9)
0.00000

Hope that helps

Axel
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: device,cursor_image ??
Next Topic: Clipboard

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

Current Time: Wed Oct 08 15:39:28 PDT 2025

Total time taken to generate the page: 0.00393 seconds