Connecting Tech Pros Worldwide Help | Site Map

check range of unsigned long

Wenjie Zhao
Guest
 
Posts: n/a
#1: Jul 19 '05
Hello,

Suppose I have a Validator class who is used to check
inputs from other interface classes' input. Particular
there is

bool Validator::checkUnsignedLongRange(unsigned long start, unsigned
long end, unsigned long value) {
return (start <= value) && (value >= end);
}

I am concerned with unsigned comparisons here when (for convenience)
use hex presentation:
validatorObject.checkUnsignedLongRange(0x00000000, 0x00016FFF);

Is the above 0x presentation OK in the context?


Best regards,
Wenjie
Closed Thread