Skip to content

Unit Equivalence

Andi Huber edited this page Apr 27, 2018 · 25 revisions

Composition table, yielding a normal-form according to https://github.com/unitsofmeasurement/unit-api/issues/89

NormalFormOrder Composition POWER RATIONAL MULTIPLY PI ADD LOG EXP
1 POWER If same base → POWER, Else → LBO RATIONAL NFO NFO COMP COMP COMP
2 RATIONAL # RATIONAL NFO NFO COMP COMP COMP
4 MULTIPLY # # MULTIPLY NFO COMP COMP COMP
3 PI # # # PI COMP COMP COMP
5 ADD # # # # ADD COMP COMP
6 LOG # # # # # COMP ID
7 EXP # # # # # # COMP

# ... Omitted due to symmetry typeOf(a ○ b) ≡ typeOf(b ○ a)

ID ... IDENTITY POWER ... PowersOfIntConverter RATIONAL ... RationalConverter MULTIPLY ... MultiplyConverter ADD ... AddConverter LOG ... LogConverter EXP ... ExpConverter PI ... PowersOfPiConverter

COMP ... composition (a, b) -> a ○ b LBO ... composition with order (lower base first) (a, b) -> sort(a, b).first ○ sort(a, b).last NFO ... composition with order (lower normal-form-order first) (a, b) -> sort(a, b).first ○ sort(a, b).last

Clone this wiki locally