FixedU128
Composite 56 v411substrate_fixed::FixedU128
About This Type
Unsigned binary fixed-point integer with `.bits` codec (substrate-fixed).
Substrate-fixed FixedU128<Frac>, commonly U64F64. Inner storage is `bits: u128`; real value = bits / 2^Frac where Frac is the use-site fractional bit count.
Encoding: Unsigned substrate-fixed `.bits` codec. Real value = bits / 2^Frac, where Frac is the binary fractional bit count from the use-site type parameter (e.g. U64F64 → Frac=64). NOT decimal accuracy.
For U64F64 (Frac=64): real = bits / 2^64.
Common Uses
- • Share-pool ratios in stake-swap accounting
- • Unsigned smoothing factors
Fields (1)
| # | Name | Type |
|---|---|---|
| 0 | bits | u128 |
SCALE Encoding
- Rule
- 1 field encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 1 field = bits: u128
0x<field0>field 0 bits: u128Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode FixedU128
const value = registry.createType("FixedU128", {
bits: 1_000_000_000n
});
console.log("Hex:", value.toHex());Type Parameters
Frac = UInt
Referenced By (5)
#39 SubtensorModule::Event via BurnIncreaseMultSet.burn_increase_mult#81 AdminUtils::Event via BurnIncreaseMultSet.burn_increase_mult#194 LockState via conviction#395 AdminUtils::Call via sudo_set_tao_flow_normalization_exponent.exponent#395 AdminUtils::Call via sudo_set_burn_increase_mult.burn_increase_mult
Type Information
- Type ID
- 56
- Kind
- Composite
- Path
- substrate_fixed::FixedU128
- Runtime
- v411