Date: 2022-04-21 10:24 (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
One effect of having a division by limit in the algorithm is that (at least on the usual kind of platform) you'll get SIGFPE or the local analogue if you pass limit==0.

Without a division, your code will presumably fail to notice the invalid input. Reading it over, it looks to me as if really_divisionless(0) will return 0, which of course is an illegal return value, because it's not true that 0 ≤ return value < limit.

Of course, all return values are illegal in this situation, for the same reason. So I'd almost (but not quite) feel happier if the function had contrived to loop forever if limit==0, because then it wouldn't return something out of range! :-)
This account has disabled anonymous posting.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2025-06-09 15:44
Powered by Dreamwidth Studios