Newest at the top
2024-11-05 20:02:48 +0100 | <dolio> | It's defined to be modular arithmetic. And apparently the reason I was having trouble is that C considers that to not be "overflow". |
2024-11-05 20:02:38 +0100 | <tomsmeding> | here (C11 draft: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf ) I find, in section 9.2.5 paragraph 9: "A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type." |
2024-11-05 20:01:46 +0100 | <dolio> | Oh okay. Yeah. |
2024-11-05 20:01:07 +0100 | AWizzArd | (~code@user/awizzard) AWizzard |
2024-11-05 20:01:07 +0100 | AWizzArd | (~code@gehrels.uberspace.de) (Changing host) |
2024-11-05 20:00:55 +0100 | <tomsmeding> | dolio: I suppose you have a physical copy? With a digital one, I would search for the quoted "a computation involving unsigned operands can never overflow" |
2024-11-05 19:59:55 +0100 | <dolio> | I think that's probably the one I have, but they only appear to cite the entire document. |
2024-11-05 19:59:24 +0100 | longlongdouble | (~longlongd@2405:201:5c16:135:7459:cd00:c885:3805) (Ping timeout: 276 seconds) |
2024-11-05 19:58:52 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) TheCoffeMaker |
2024-11-05 19:57:59 +0100 | SlackCoder | (~SlackCode@64-94-63-8.ip.weststar.net.ky) SlackCoder |
2024-11-05 19:57:59 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) (Remote host closed the connection) |
2024-11-05 19:56:18 +0100 | BolzmannPain | (~BolzmannP@user/BolzmannPain) (Quit: Client closed) |
2024-11-05 19:55:56 +0100 | SlackCoder | (~SlackCode@64-94-63-8.ip.weststar.net.ky) (Quit: Leaving) |
2024-11-05 19:50:29 +0100 | <tomsmeding> | it refers to C11 |
2024-11-05 19:50:25 +0100 | <tomsmeding> | the wikipedia article has a citation, perhaps that helps? |
2024-11-05 19:50:14 +0100 | <dolio> | I probably don't know what term to search for. |
2024-11-05 19:49:55 +0100 | <tomsmeding> | dolio++ for even trying |
2024-11-05 19:49:25 +0100 | <dolio> | I tried to look in my copy of the standard, but it's hard to find stuff in there. |
2024-11-05 19:45:48 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) TheCoffeMaker |
2024-11-05 19:44:52 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) (Quit: So long and thanks for all the fish) |
2024-11-05 19:37:15 +0100 | Nachtgespenst | (~user@user/siracusa) (Quit: Bye!) |
2024-11-05 19:18:21 +0100 | BolzmannPain | (~BolzmannP@user/BolzmannPain) BolzmannPain |
2024-11-05 19:18:18 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2024-11-05 19:17:28 +0100 | l-Shane-l | (~l-Shane-l@user/l-Shane-l) (Quit: Client closed) |
2024-11-05 19:14:39 +0100 | chele | (~chele@user/chele) (Remote host closed the connection) |
2024-11-05 19:13:08 +0100 | sprotte24 | (~sprotte24@134.245.44.86) |
2024-11-05 19:10:58 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-11-05 19:03:03 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-11-05 19:02:23 +0100 | tyzef | (~tyzef@user/tyzef) (Quit: WeeChat 3.8) |
2024-11-05 18:51:58 +0100 | Leonard26 | (~Leonard26@49.236.10.26) (Quit: Client closed) |
2024-11-05 18:49:31 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-11-05 18:45:51 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2024-11-05 18:39:34 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 265 seconds) |
2024-11-05 18:38:15 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) (Ping timeout: 252 seconds) |
2024-11-05 18:37:34 +0100 | tyzef | (~tyzef@user/tyzef) tyzef |
2024-11-05 18:36:12 +0100 | mulk | (~mulk@pd95146e9.dip0.t-ipconnect.de) mulk |
2024-11-05 18:32:05 +0100 | mulk | (~mulk@pd95146e9.dip0.t-ipconnect.de) (Quit: ZNC - http://znc.in) |
2024-11-05 18:29:05 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-11-05 18:25:38 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-11-05 18:22:19 +0100 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
2024-11-05 18:21:30 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds) |
2024-11-05 18:17:15 +0100 | spew | (~spew@201.141.99.170) spew |
2024-11-05 18:14:50 +0100 | <tomsmeding> | now I'm aware that wikipedia is not a definitive source :) |
2024-11-05 18:14:42 +0100 | <tomsmeding> | wikipedia agrees with me (last paragraph of the introduction) https://en.wikipedia.org/wiki/Integer_overflow |
2024-11-05 18:14:36 +0100 | Pozyomka | (~pyon@user/pyon) (Ping timeout: 272 seconds) |
2024-11-05 18:13:24 +0100 | <tomsmeding> | and I'm fairly sure that it's actually _defined_ to wrap, not only implementation-defined |
2024-11-05 18:13:08 +0100 | <c_wraith> | in all cases it *is* defined! |
2024-11-05 18:13:03 +0100 | <tomsmeding> | (certainly not saturating because then the common implementations would be wrong) |
2024-11-05 18:12:45 +0100 | <tomsmeding> | for regular old unsigned types, it's wrapping |
2024-11-05 18:12:32 +0100 | <c_wraith> | I can't remember if C defines the results as wrapping, saturating, or makes it implementation-defined |