check range of unsigned long

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wenjie Zhao

    check range of unsigned long

    Hello,

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

    bool Validator::chec kUnsignedLongRa nge(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 .checkUnsignedL ongRange(0x0000 0000, 0x00016FFF);

    Is the above 0x presentation OK in the context?


    Best regards,
    Wenjie
Working...