W
Wenjie Zhao
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
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