Article 5RDS0 Fractions in Unicode

Fractions in Unicode

by
John
from John D. Cook on (#5RDS0)

There are Unicode characters for a few fractions, such as . This looks a little better than 1/2, depending on the context.

Here's the Taylor series for log(1 + x) written in pure HTML:

log(1 + x) = x - x^2 + x^3 - 1/4x + x -

See this post for how the exponents were made.

Notice that the three dots on the end are centered vertically, like \cdots in LaTeX. This was done with ⋯ (U+22EF).

Available fractions

The selection of available fraction number forms is small and a little strange.

There are characters for fractions with denominator d equal to 2, 3, 4, 5, 6, and 8, with numerators 1 through d-1, except for fractions that can be reduced.

If d = 7, 9, or 10, there's a character for 1/d but not for fractions with numerators other than 1. For example, there is a character for but not for 2/7.

HTML Entities

For denominators 2, 3, 4, 5, 6, and 8 the HTML entity for characters is easy: they all have the form

& frac <n> <d> ;

where n is the numerator and d is the denominator. For example, &frac35; is the HTML entity for .

There are no HTML entities for 1/7, 1/9, or 1/10.

Related postsThe post Fractions in Unicode first appeared on John D. Cook.Qv-3WpPN_0A
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments