546120250450653184, 867967467770920960, 1322594445548802050, 1514227321271635970, 1554821487797760000, 1611409453806403586, 1698349154106274129

This commit is contained in:
ed committed 2026-08-27 19:52:09 -04:00
1 parent 11efeff692
commit 1c92f5879d
31 files changed
+1227

No files matched your search

@@ -0,0 +1,37 @@
---
title: "@EricLengyel @ben_nuttall Gives me the heebie jeebies since overflow is undefined behaviour in C."
type: archive
source: twitter
source_url: "https://x.com/fanf/status/546412114408407041"
author: "Tony Finch"
handle: fanf
post_id: "546412114408407041"
date: 2014-12-20
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "@EricLengyel @ben_nuttall Gives me the heebie jeebies since overflow is undefined behaviour in C."
in_reply_to: ""
parent_post_id: "546120250450653184"
---
## Source
- URL: https://x.com/fanf/status/546412114408407041
- Author: Tony Finch (@fanf)
- Posted: 2014-12-20 21:09:34
## Branch
**1/** **@fanf** ^546412114408407041
**@EricLengyel** **@ben_nuttall**
Gives me the heebie jeebies since overflow is undefined behaviour in C. Need more (unsigned) casts…
## Related
- Spine: [[archive/threads/EricLengyel/2014-12-20-remember-that-integer-range-checks-can-always-be]]
@@ -0,0 +1,32 @@
---
title: "Remember that integer range checks can always be done with only one comparison: (unsigned) (x - min) <= (unsigned) (max - min)"
type: archive
source: twitter
source_url: "https://x.com/EricLengyel/status/546120250450653184"
author: "Eric Lengyel"
handle: EricLengyel
post_id: "546120250450653184"
date: 2014-12-20
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "Remember that integer range checks can always be done with only one comparison: (unsigned) (x - min) <= (unsigned) (max - min)"
in_reply_to: ""
---
## Source
- URL: https://x.com/EricLengyel/status/546120250450653184
- Author: Eric Lengyel (@EricLengyel)
- Posted: 2014-12-20 01:49:48
## Thread
**1/** **@EricLengyel** ^546120250450653184
Remember that integer range checks can always be done with only one comparison: (unsigned) (x - min) <= (unsigned) (max - min)
Branches: [[archive/threads/EricLengyel/2014-12-20-remember-that-integer-range-checks-can-always-be/2014-12-20-fanf-gives-me-the-heebie-jeebies-since-overflow-is]]
@@ -0,0 +1,37 @@
---
title: "@EricLengyel @dsuoch Yeah, this is one of the things coworkers hate me for"
type: archive
source: twitter
source_url: "https://x.com/noop_dev/status/868150884194189314"
author: "Boris Chuprin"
handle: noop_dev
post_id: "868150884194189314"
date: 2017-05-26
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "@EricLengyel @dsuoch Yeah, this is one of the things coworkers hate me for"
in_reply_to: ""
parent_post_id: "867967467770920960"
---
## Source
- URL: https://x.com/noop_dev/status/868150884194189314
- Author: Boris Chuprin (@noop_dev)
- Posted: 2017-05-26 17:04:34
## Branch
**1/** **@noop_dev** ^868150884194189314
**@EricLengyel** **@dsuoch**
Yeah, this is one of the things coworkers hate me for
## Related
- Spine: [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed]]
@@ -0,0 +1,37 @@
---
title: "@EricLengyel Otherwise UB if hi == INT_MAX and lo == INT_MIN"
type: archive
source: twitter
source_url: "https://x.com/vaughncato/status/868087562287579137"
author: "Vaughn Cato"
handle: vaughncato
post_id: "868087562287579137"
date: 2017-05-26
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "@EricLengyel Otherwise UB if hi == INT_MAX and lo == INT_MIN"
in_reply_to: ""
parent_post_id: "867967467770920960"
---
## Source
- URL: https://x.com/vaughncato/status/868087562287579137
- Author: Vaughn Cato (@vaughncato)
- Posted: 2017-05-26 12:52:57
## Branch
**1/** **@vaughncato** ^868087562287579137
**@EricLengyel**
Otherwise UB if hi == INT_MAX and lo == INT_MIN
## Related
- Spine: [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed]]
@@ -0,0 +1,43 @@
---
title: "@EricLengyel Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`"
type: archive
source: twitter
source_url: "https://x.com/vaughncato/status/868086438092582912"
author: "Vaughn Cato"
handle: vaughncato
post_id: "868086438092582912"
date: 2017-05-26
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "@EricLengyel Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`"
in_reply_to: ""
parent_post_id: "867967467770920960"
---
## Source
- URL: https://x.com/vaughncato/status/868086438092582912
- Author: Vaughn Cato (@vaughncato)
- Posted: 2017-05-26 12:48:29
## Branch
**1/** **@vaughncato** ^868086438092582912
**@EricLengyel**
Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`
**2/** **@EricLengyel** ^868252570136870912
**@vaughncato**
Sure. Let me take this opportunity to say that I have zero respect for a language that has any undefined behavior whatsoever.
## Related
- Spine: [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed]]
@@ -0,0 +1,37 @@
---
title: "@EricLengyel @Atrix256 One of my favs."
type: archive
source: twitter
source_url: "https://x.com/sreekotay/status/868268000499167232"
author: "sree kotay"
handle: sreekotay
post_id: "868268000499167232"
date: 2017-05-27
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "@EricLengyel @Atrix256 One of my favs."
in_reply_to: ""
parent_post_id: "867967467770920960"
---
## Source
- URL: https://x.com/sreekotay/status/868268000499167232
- Author: sree kotay (@sreekotay)
- Posted: 2017-05-27 00:49:57
## Branch
**1/** **@sreekotay** ^868268000499167232
**@EricLengyel** **@Atrix256**
One of my favs. And special cases possible for testing power of 2 ranges (just a mask, no subtracts)... :)
## Related
- Spine: [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed]]
@@ -0,0 +1,32 @@
---
title: "Needs repeating: You can always perform a signed integer range test with a single comparison."
type: archive
source: twitter
source_url: "https://x.com/EricLengyel/status/867967467770920960"
author: "Eric Lengyel"
handle: EricLengyel
post_id: "867967467770920960"
date: 2017-05-26
archived: 2026-08-27
draft: false
tags:
- archive
- twitter
- EricLengyel
description: "Needs repeating: You can always perform a signed integer range test with a single comparison."
in_reply_to: ""
---
## Source
- URL: https://x.com/EricLengyel/status/867967467770920960
- Author: Eric Lengyel (@EricLengyel)
- Posted: 2017-05-26 04:55:45
## Thread
**1/** **@EricLengyel** ^867967467770920960
Needs repeating: You can always perform a signed integer range test with a single comparison. unsigned(x - lo) <= unsigned(hi - lo)
Branches: [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed/2017-05-26-vaughncato-shouldnt-that-be-unsigned-x-unsigned-lo-unsigned]], [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed/2017-05-26-vaughncato-otherwise-ub-if-hi-int-max-and-lo-int-min]], [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed/2017-05-26-noop_dev-yeah-this-is-one-of-the-things-coworkers-hate-me]], [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed/2017-05-27-sreekotay-one-of-my-favs-and-special-cases-possible-for]]
+2
View File
@@ -9,4 +9,6 @@ tags:
- EricLengyel
---
- [[archive/threads/EricLengyel/2014-12-20-remember-that-integer-range-checks-can-always-be]]
- [[archive/threads/EricLengyel/2017-05-26-needs-repeating-you-can-always-perform-a-signed]]
- [[archive/threads/EricLengyel/2026-01-23-ive-worked-very-hard-over-many-years-to-develop-a]]