[−][src]Crate sp_arithmetic
Minimal fixed point arithmetic primitives and types for runtime.
Modules
biguint | Infinite precision unsigned integer for substrate runtime. |
helpers_128bit | Some helper functions to work with 128bit numbers. Note that the functionality provided here is only sensible to use with 128bit numbers because for smaller sizes, you can always rely on assumptions of a bigger type (u128) being available, or simply create a per-thing and use the multiplication implementation provided there. |
traits | Primitive traits for the runtime arithmetic. |
Macros
assert_eq_error_rate | Copied from |
Structs
FixedI64 | A fixed point number representation in the range. |
FixedI128 | A fixed point number representation in the range. |
FixedU128 | A fixed point number representation in the range. |
PerU16 | A fixed point representation of a number in the range [0, 1]. |
Perbill | A fixed point representation of a number in the range [0, 1]. |
Percent | A fixed point representation of a number in the range [0, 1]. |
Permill | A fixed point representation of a number in the range [0, 1]. |
Perquintill | A fixed point representation of a number in the range [0, 1]. |
Rational128 | A wrapper for any rational number with a 128 bit numerator and denominator. |
Traits
FixedPointNumber | Something that implements a decimal fixed point number. |
FixedPointOperand | Integer types that can be used to interact with |
Normalizable | A collection-like object that is made of values of type |
PerThing | Something that implements a fixed point ration with an arbitrary granularity |
ThresholdOrd | Trait for comparing two numbers with an threshold. |
Functions
normalize | Normalize |
Type Definitions
InnerOf | Get the inner type of a |
UpperOf | Get the upper type of a |