Epsilon (ε) in HTML
Epsilon is the fifth Greek letter, written Ε and ε. The capital is at U+0395 and the small letter at U+03B5.
At a glance
- Character
- Ε ε
- Named entity
- Ε ε
- Decimal reference
- Ε ε
- Hex reference
- Ε ε
- Unicode code point
- U+0395, U+03B5
- Unicode name
- GREEK CAPITAL LETTER EPSILON, GREEK SMALL LETTER EPSILON
- In the entity reference
- Greek
In detail
Epsilon conventionally names a quantity that is as small as you like but not zero. That is its role in the formal definition of a limit, where for every epsilon there must exist a delta, and it carries the same connotation everywhere else it appears: a tolerance, a slack, a margin below which a difference does not matter.
In floating point arithmetic, machine epsilon is the gap between one and the next representable number above it. It is the reason two calculations that are algebraically equal can differ in their last bits, and the reason an equality test between two computed floats is unreliable. The usual remedy is to compare the absolute difference against a tolerance rather than testing for equality.
A relative tolerance is almost always better than an absolute one. A fixed epsilon that is sensible for numbers near one is far too large for numbers near a millionth and far too small for numbers in the billions, so scaling the tolerance by the magnitude of the values being compared is what makes the check behave the same across a range.
Two glyphs exist for the small letter. The reversed three shape is the ordinary Greek small epsilon at U+03B5; the lunate form at U+03F5 is a separate code point used in some mathematical typography. They are different characters, so a document mixing them will not match itself in a search.
Examples
Number.EPSILON; // about 2.22e-16
function nearlyEqual(a, b, rel = 1e-9) {
return Math.abs(a - b) <= rel * Math.max(Math.abs(a), Math.abs(b));
}
0.1 + 0.2 === 0.3; // false
nearlyEqual(0.1 + 0.2, 0.3); // true<p>ordinary: ε (U+03B5)</p>
<p>lunate: ϵ (U+03F5)</p>Things that catch people out
- A single hard coded tolerance breaks at the extremes of a range. Scale it relative to the magnitudes being compared.
- Machine epsilon is not the smallest representable number. It is the spacing between representable numbers near one, which is a much larger quantity.
- The lunate epsilon is a different code point from the ordinary one and will not match it in a comparison or a search.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Delta (δ) in HTML
The Greek letter delta at U+0394 and U+03B4, its entity forms, the increment sign that looks identical, and what a capital delta asserts about a quantity.
Theta (θ) in HTML
The Greek letter theta at U+0398 and U+03B8, its entity forms, its role as the default angle variable, and what big theta asserts about an algorithm.
Mathematical operator entities: sets, logic and calculus
Named entities for summation, integral, partial differential, set membership, union, intersection and the logical connectives, with their code points.
Lambda (λ) in HTML
The Greek letter lambda at U+039B and U+03BB, its entity forms, its use for wavelength and decay, and where the anonymous function name came from.
Mu (μ) in HTML
The Greek letter mu at U+039C and U+03BC, its entity forms, the separate micro sign it duplicates, and its meanings in statistics and mechanics.
Pi (π) in HTML
The Greek letter pi at U+03A0 and U+03C0, its entity forms, the capital pi that is not the product operator, and how to write pi in code correctly.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- HTML Entity Encoder Free online HTML entity encoder - encode or decode HTML entities to prevent XSS and display issues