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
GDL weirdness (bug?) with modulo command [message #88331] Tue, 15 April 2014 07:44 Go to previous message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
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?
[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: Wed Oct 08 20:01:54 PDT 2025

Total time taken to generate the page: 0.43063 seconds