in reply to int's behaviour
sub round { map{ int($_ + 0.5) @_ }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: int's behaviour
by last_stand (Initiate) on Nov 25, 2007 at 16:49 UTC | |
now when I do: $range_int= int($range_data); and try to print range_data and range_int i get different values.specifically 65535 becomes 65534 and 255 becomes 254. Also I know range_data is 65535 and not 65534.99 . Can anyone help me. | [reply] [d/l] [select] |
by Corion (Patriarch) on Nov 25, 2007 at 17:02 UTC | |
Either the code you posted is not the code you are using or you should be using the strict pragma. You are initializing a variable $step but you are dividing by a variable $step_real. Also, please post a complete, self-contained, short program that demonstrates the issue. You talk about variables with names like range_data and range_int but never show how and where they are used. | [reply] [d/l] [select] |
by last_stand (Initiate) on Nov 25, 2007 at 17:15 UTC | |
The split is done to obtain the actual step values in cases where i read (say:100/65535) at step(read resolution). the reading tagged data function is: since i am very new to all this i thought that my code may seem stupid to u guys!! thats why i was hiding some part. But now I DONT CARE!!!! | [reply] [d/l] [select] |
by Corion (Patriarch) on Nov 25, 2007 at 18:12 UTC | |