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

Home » Public Forums » archive » Re: -0.0
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: -0.0 [message #74533] Fri, 21 January 2011 16:13 Go to previous message
kisCA is currently offline  kisCA
Messages: 78
Registered: January 2011
Member
On Jan 20, 2:29 pm, Paolo <pgri...@gmail.com> wrote:
> On Jan 20, 2:22 pm, kisCA <ki...@hotmail.com> wrote:
>
>> I like this "sky is falling" things :-)
>
>> I guess that it could be a problem of precision with float...the range
>> should be higher in positive value in order to have 0 on the positive
>> side?
>
>> Thanks!
>
> Well yes. What happens is that when you do
>
> plot,[0,0],xrange=[-0.6,0.6],xtickv=vvv
>
> is that the plot range is given by
>
> r=!X.crange
>
> print,r,format='(f13.10)'
> -0.6000000238
>  0.5999999762
>
> IDL presumably uses the following formula to create 7 tick marks:
>
> tickv=r[0]+(r[1]-r[0])/6.0*findgen(7)
>
> print,tickv,format='(f13.10)'
> -0.6000000238
> -0.4000000238
> -0.2000000238
> -0.0000000238
>  0.1999999762
>  0.3999999762
>  0.5999999762
>
> When rounded to something more useful for plots:
>
> print,tickv,format='(f4.1)'
> -0.6
> -0.4
> -0.2
> -0.0
>  0.2
>  0.4
>  0.6
>
> That's how you get the negative zero.
>
> Ciao,
> Paolo

Well demonstrated. Thanks for the teaching!

Cheers
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Crashes in IDL 7.1 & 8.0, interactive + VM mode, linux and Mac OS X
Next Topic: FSC_contour & NaN

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

Current Time: Wed Oct 08 13:39:14 PDT 2025

Total time taken to generate the page: 0.00358 seconds