Comment

Comment by bunderbunder

I almost want two different division operations: One where 1/0 = 0, exclusively for use in progress bars and stuff like that, and another one for everything else.

Because frequently division by zero indicates a bug. But similarly frequently, I end up crapping out annoying little bits of code like

  if (foo == 0):
    return 0
  else:
    return bar / foo

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton