Open mpusz opened 4 years ago
which unicode code points? Couldn't obviously find superscript fractions. Or did you mean "radical" symbols like an actual square root. That would be most unusual? or did you just mean m^½ currently it prints: m^(1/2)
I think that "m½" is self-explanatory and we might not need additional "^" sign but we can decide otherwise. Here is the info how to create any ratio: https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts.
yes. I know about "composing fractions using sub/superscripts", but those are not "superscripts overall" and therefore only questionably suitable for representing an exponent?
In fact I think it's logical that fractional superscripts don't exist as a font glyph. The single digit superscripts are difficult enough to read at normal font sizes, so fractional superscripts would likely be unreadable below 20pt? Really to display this sort of thing properly we need a "1.5 x line height" (at least) layout object, and we clearly can't do that without outputting postscript or latex.
So you are suggesting, we abandon the idea of the these actually being exponents/superscripts?
and just write (effectively) "m * 1/2" ?
So you are suggesting, we abandon the idea of the these actually being exponents/superscripts? and just write (effectively) "m * 1/2"?
No. If we are about to stay with ASCII I think that the current spelling "m^(1/2)" is better. It is that in one of the libraries I analyzed I saw they use unicodes for fractional exponents too and the resulting dimensions were easier to read (in my opinion).
That's a misunderstanding. I agree that the best ASCII is the status quo.
What I was trying to point out is that
m½
to my eyes (and this is subjective) looks more like
m * (1/2)
than like
m^(1/2)
actually m½ doesn't look like anything very sensible to my eyes.
In my opinion writing non-trivial mathematical expressions nicely is not really possible "on a single line of text". That's why there are specialised languages for that. And a basic convention for how to use ASCII, which is not too pretty, but unambiguous.
My understanding is that fractional exponents will usually appear in intermediate results and will be printed mostly for debugging purposes. I don't see much need in perfecting their looks.
There are ony a few physical quantities that really use them. I was provided one of them some time ago but I lost it and do not remember the name of the quantity.
I did some googling and it led me to this discussion (funny enough, about another physical units library) and there are a couple of examples:
@i-ky what you have there looks much better to my eyes!
superscript, but just simple '/' fraction...you can still see it's an exponent
unless someone objects I'll just implement that ... but not go overboard since it seems this is pretty niche
@oschonrock what I'm using there is not plain Unicode, I've cheated using <sup>...</sup>
. And although you can get superscript digits, there is no way to represent superscript solidus with Unicode.
@i-ky Damn, but somehow I smelled that.
Oh well, this can remain on low priority table then, given we are struggling to come up with a use case outside of "amplitude spectral density".
Well, we can always cheat: https://stackoverflow.com/a/49325148 ;-)
Provide nice Unicode symbols for fractional exponents wherever possible.