← Back to context

Comment by Aardwolf

3 years ago

Which one of these, then, is for minus?

Good/bad news: It should be U+2212 MINUS SIGN like this: −1, which is none of the others. It looks better than hyphen: -1, doesn't it?

Matplotlib example: https://matplotlib.org/stable/gallery/text_labels_and_annota...

  • Personally I’ve always preferred a minus sign closer, like the latter. While the subtraction operator looks better as the former. But I think this is just a calculator-ism that has infected my math syntax.

    But especially for matrix inversion, the super wide subtraction symbol just looks awful to me. A little calculator style minus symbol is also nice because it’ll clear the matrix more easily…

Hyphen. You'll also hear it called "hyphen-minus"

  • "Hyphen‐minus" is an ASCII abomination, and should only be used in ASCII‐constrained environments. Hyphen is hyphen and minus is minus:

    ‐ 002010;HYPHEN;Pd;0;ON;;;;;N;;;;;

    − 002212;MINUS SIGN;Sm;0;ES;;;;;N;;;;;

    • The issue of non-ASCII-constrained environments is that it's still not easily accessible on most keyboards.

      I do know and use the compose key but it's not the same as having a standard key for it. Trying on a mobile device, long pressing the dash key there suggests 2 dashes (not sure if the second choice is en-dash or em-dash), which is some but that's not the 4 types discussed here.

      3 replies →

    • I was wondering what's better. The document is clearer if we use unicode.

      But maybe for humans it's easier if we have a limited character set and use context instead. Like this.

      In plain text, - is a hyphen:

          twenty-five, -1
      

      In math context - is a minus sign

          $ (-1)^3 + x^3 $
      

      Where it will be ensured to be rendered as appropriate

      1 reply →