Link to home
Start Free TrialLog in
Avatar of developingprogrammer
developingprogrammer

asked on

Test if number is integer

Hey guys, I know there are various ways of testing if a number is an integer or not, but what's the best way to do it? The sort of "official" IsInteger method kinda thing.

Thanks guys!!
Avatar of duttcom
duttcom
Flag of Australia image

ISNUMERIC is a boolean property which will return 1 if the field contains a number (not specifically an interger though) and 0 if it is not.
ASKER CERTIFIED SOLUTION
Avatar of Bitsqueezer
Bitsqueezer
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Der. I should have read the question more closely. Christian is spot-on.
Avatar of developingprogrammer
developingprogrammer

ASKER

Cool thanks Christian!! = )) thanks duttcom too!!

Hrmm duttcom I also think that true should equal to 1, but somehow in Access they set it to -1.

Why -1? I'm no sure but maybe because it doesn't want to use the positive bits. Hrmm no wait a Boolean is a value type by itself. So it takes one bit I believe. So why when we convert it to a number it uses 2 bits? One bit for sign, one bit for the value. Hrmm I'm not sure. Ok lets ask Christian! (P.S. duttcom, Christian knows EVERYTHING about programming. Hrmm and that's probably an understatement already haha. I'm very fortunate to have him help me out all the way!! = ))))   )

Christian! If you don't mind, could you share your thoughts on why true is -1 instead of 1 when I cint it? Seems like Boolean is taking 2 bits!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WHAO! see duttcom whaddiya say? haha = PP i even need to re-read this and figure out the sub-concepts it covers! benefits of bitwise operations using 16 bit variable (but that's cause i'm at beginner level and soon to be familiar with these concepts!!

(to Christian - reading reading reading reading reading)

hahaha = )) thanks Christian!! let me digest this!! = ))
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cool thanks Christian! i'll go through this again next week!! = ))