[−][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
| Fixed64 | A fixed point number representation in the range. |
| Fixed128 | 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. |
| PerThing | Something that implements a fixed point ration with an arbitrary granularity |