Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

[WIP] Floating Point Article #14

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions current/runtime/floats.md
Original file line number Diff line number Diff line change
@@ -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)