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

Home » Public Forums » archive » GDL weirdness (bug?) with modulo command
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: GDL weirdness (bug?) with modulo command [message #88336 is a reply to message #88331] Tue, 15 April 2014 11:50 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, April 15, 2014 10:44:33 AM UTC-4, rj...@le.ac.uk wrote:
> I'm not sure if this is a bug or if I'm missing something and I know there's a fair few GDL users here.
>
>
>
> I was using the mod command to get the remainder from a value and then fixing it to be an integer and I noticed that some of the values were wrong.
>
>
>
> I looked into it a bit more and think I can summarise the issue as:
>
>
>
> GDL> print, 200.0 mod 12
>
> 7.99999
>
> GDL> print, 200D mod 12
>
> 8.0000000
>
>
>
> i.e. if the variable is a float, the mod command doesn't return the integer that you expect it to. If it's a double then you get the expected answer.
>
>
>
> Am I missing some subtlety here or is this a bug?

This is probably the issue...
https://www.idlcoyote.com/math_tips/sky_is_falling.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Assigning the values of a matrix to a larger matrix
Next Topic: Contour labels not aligned with contours

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

Current Time: Thu Oct 09 07:35:27 PDT 2025

Total time taken to generate the page: 0.55771 seconds