Threadwell

Recent Notes

  • DemetriSpanos

    Oct 06, 2026

    • archive
    • twitter
    • demetrispanos
  • NOTimothyLottes

    Oct 06, 2026

    • archive
    • twitter
    • notimothylottes
  • bonzajplc

    Oct 06, 2026

    • archive
    • twitter
    • bonzajplc
Home

❯

Archive

❯

Threads

❯

EricLengyel

❯

Needs repeating: You can always perform a signed integer range test with a single comparison.

❯

@EricLengyel Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`

@EricLengyel Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`

Properties5
typearchive
sourcetwitter
date2017-05-26
tagsarchive, twitter, ericlengyel
description@EricLengyel Shouldn't that be `unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)`

May 26, 20171 min read

  • archive
  • twitter
  • ericlengyel

Source

  • URL: https://x.com/vaughncato/status/868086438092582912
  • Author: Vaughn Cato (@vaughncato)
  • Posted: 2017-05-26 12:48:29

Branch

1/ @vaughncato

@EricLengyel

Shouldn’t that be unsigned(x)-unsigned(lo) <= unsigned(hi)-unsigned(lo)

2/ @EricLengyel

@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: 2017-05-26-needs-repeating-you-can-always-perform-a-signed

Graph View

  • Source
  • Branch
  • Related

Backlinks

  • Needs repeating: You can always perform a signed integer range test with a single comparison.

Created with Quartz v5.0.0 © 2026

  • GitHub