|
|
Subscribe / Log in / New account

Better handling of integer wraparound in the kernel

Better handling of integer wraparound in the kernel

Posted Jan 29, 2024 8:43 UTC (Mon) by gspr (subscriber, #91542)
In reply to: Better handling of integer wraparound in the kernel by tialaramex
Parent article: Better handling of integer wraparound in the kernel

> There will be infinitely many such numbers since 0 and UINT_MAX are definitionally different numbers, we can definitely always find a new different number between them, and so on forever.

As a mathematician, I'd find this response silly. If you want to be pedantic: "number" does not imply "real number" any more than it implies "integer". In fact, I'd argue that without any further context, then the fact that the name UINT_MAX seems to carry the implication of being an integer is enough for a reasonable person to at least assume that the question is about integers.

Your answer would come off to me as quite obtuse. Sure, nothing wrong with clarifying along the lines of "you mean integers, right?" But assuming reals and stating that the problem cannot be solved is just silly. And problematic because you, too, made a whole bunch of assumptions about the (somewhat imprecisely specified) task.


to post comments

Better handling of integer wraparound in the kernel

Posted Jan 29, 2024 19:11 UTC (Mon) by tialaramex (subscriber, #21167) [Link]

That's a fair point, unlike INT_MAX (whose definition is just a number) UINT_MAX is typically defined as an actual unsigned integer using the suffix U for parsing reasons, and thus (on a platform where that's the case) it really is actually an unsigned integer like Rust's u32::MAX, not just a number.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds