diff --git a/current/runtime/floats.md b/current/runtime/floats.md new file mode 100644 index 0000000..d0d3c59 --- /dev/null +++ b/current/runtime/floats.md @@ -0,0 +1,35 @@ +--- +slug: floats +lang: en +title: Floating Point Numbers +--- + +When developing for the Substrate runtime and doing calculations it is appealing to use floating point numbers for e.g. representing fractions. This document covers why traditional floating point numbers are problematic in a runtime context and what alternatives exist. + +## Problems with Floating Point Numbers in the Runtime + +## Alternatives + +### Perbill and Friends + +### substrate-fixed +[substrate-fixed repo](https://github.com/encointer/substrate-fixed) + + +## Next Steps +**TODO** + +### Learn More + +- + +### Examples + +- [Fixed Point Recipe](https://github.com/substrate-developer-hub/recipes/pull/196) + +### References + +- View the [primitive types defined in + `node-primitives`](https://substrate.dev/rustdocs/master/node_primitives/index.html). + +- View the [`traits` defined in `sp-runtime`](https://substrate.dev/rustdocs/master/sp_runtime/traits/index.html)