short_decimal library

The int64 family alone: ShortDecimal, its fraction, its division, its exception.

The same ShortDecimal the umbrella denary.dart exports, without Decimal and without the bridge between the two. Import this one where the values are known to be small and the speed is the point — remembering that overflow here is silent.

import 'package:denary/short_decimal.dart';

final price = ShortDecimal.parse('19.99');
print(price * ShortDecimal(3)); // 59.97

Classes

ShortDecimal
A decimal number with a fixed point, kept in an int.
ShortDivision
A whole quotient together with the remainder that did not fit into it.
ShortFraction
An exact ratio of two integers: what division answers when a decimal cannot.

Extensions

ShortDecimalIntExtension on int
Conversion from int.

Exceptions / Errors

DecimalDigitsOutOfRangeError
A number of digits, or a power of ten, past what this package will build.
ScaleOutOfRangeError
A scale that would leave int64.
ShortDecimalDivideException
Thrown by ShortDecimal.operator / when the result has no finite decimal form.