Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Newbie And Furious
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location:
Posted: 6th Jul 2010 20:47
Hi,
is there a tricky way to check if a number is whole than that one?







<VGM>
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Jul 2010 21:36
if var# = int(var#)

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Jul 2010 14:18 Edited at: 9th Jul 2010 14:20
If you want to account for small errors, you can use
if abs(var# - int(var# + 0.5)) < ERROR (eg. 0.000001)

[edit] This only works for positive values, use
if abs(var# - int(var# - 0.5)) < ERROR
instead.

Cheers!
Sven B

Login to post a reply

Server time is: 2024-11-23 14:21:14
Your offset time is: 2024-11-23 14:21:14