Hwaro::Assets::Sass::Number
Inherits Hwaro::Assets::Sass::Value < Reference < Object
Constants
dart-sass treats numbers within 1e-11 of each other as equal
(0.1 * 3 == 0.3); floor/ceil/round are exact there.
Convertible-unit groups (dart-sass's known compatibilities): {group id, factor to the group's canonical unit}. Lookup is case-insensitive because CSS units are.
Constructors
Class methods
Multiplier that converts a value in from units to to units;
nil when the units aren't in the same convertible group.
dart-sass-style number formatting: integers without a decimal point, floats rounded to 10 digits with trailing zeros trimmed.
Never routes through Float64#to_s, which switches to exponent
form outside roughly [1e-4, 1e16). CSS has no exponent syntax and
no Infinity/NaN literals, so 3.33333e-5px is not a number a
browser can read — it drops the whole declaration. Small values
are reachable from ordinary ratio math (opacity, scale).
dart-sass fuzzyEquals: within epsilon AND the same value once
scaled and rounded, so 0.4e-11 and 0.6e-11 stay distinct.
Instance methods
The other operand's value expressed in THIS number's unit (the
left operand of an arithmetic expression wins the unit, dart-sass
semantics). Callers must have checked compatible_unit?.
Identical units, one side unitless, or units in the same convertible group (px↔in, deg↔turn, s↔ms, ...).
Sass equality (==). Subclasses override; default is identity
on serialized text.
Storage keeps every bit of a computed number. The ten-digit CSS
spelling turned a running $factor: $factor * 0.1 into 0 after
eleven steps (Foundation's long-division divide() returned 0px
for 10px / 3) and let rounding error pile up across loops. The
precise spelling is never emitted: see precise_spelling?.
Original source spelling (".5em"); kept so uncomputed numbers serialize byte-identically.