Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.

Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.

Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.

Really hoping he hasn’t brought the jinx with him.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 2 Posts
  • 2.53K Comments
Joined 2 年前
cake
Cake day: 2024年8月13日

help-circle










  • Yeah, I’ve actually written quick and dirty code that used both a division and a modulus, but then went back later to use the former to calculate the latter with a multiplication and a subtraction to get a speed improvement.

    There have been other occasions where I’ve been able to replace something like average = sum / count; if average > y with if sum > count * y, when it’s not entirely obvious that y could be multiplied by anything and remain meaningful.

    But when a division can’t be avoided, you still want that genius-written magical library to take some of the sting out of it.


  • The mention of division has triggered a memory. I think I actually saw a library like that once. It was in C, not assembly, and was almost certainly for one specific architecture (probably Intel), but other than that, there was a lot of low-level stuff that claimed to make division faster for all CPU-native data types.

    It was above my skill level to just pick up and use, let alone read and understand, but I can tell you that it at least looked legit, and the author seemed earnest in their description, so something like your hypothetical is very much out there.








  • Interesting. For as long as I’ve been alive, it hasn’t been legal here (UK) for a brand to specifically name and disparage another brand in their advertising like that. (This doesn’t apply to political parties, for “reasons”, but I digress.)

    That is, I’m not sure how it came to be in my head. I had thought I had come up with it independently, but I have to admit there’s a chance I’ve seen someone else use it over the intervening decades, and it has ultimately come from the advertising you’re quoting.