http://qs321.pair.com?node_id=11113422


in reply to Detecting whether UV fits into an NV

Is this an "It annoys me because"

  1. it doesn't look elegant
  2. my application needs it to be performant and even a short loop isn't
  3. some other reason I'm going to tell you about

If it is case 1 then I suspect you are out of luck. The only other ways I can think of doing it are even worse, or hardware dependent, or are a maintenance nightmare.

For case 2 there are techniques like binary searches that maybe can run faster or a really nasty looking series of if statements that amount to unrolling the while loop.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond