Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 49e4eaf

Browse files
authored
Add diagram containing decimal and integer conversion overview (#225)
2 parents 0672542 + 1b38f5f commit 49e4eaf

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed
52 KB
Loading

src/pages/core/architecture/actor-model.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rummage around in their belongings (state). They simply exchange messages and pu
3535
other side needs to know into a message.
3636

3737
<Image
38-
src="/actor-model.svg"
38+
src="/diagrams/actor-model.svg"
3939
alt="Actor model"
4040
style={{ marginTop: "1em", marginBottom: "1em" }}
4141
width={1920}

src/pages/core/standard-library/math.mdx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,25 @@ import { Callout } from "nextra/components";
77
# Math
88

99
CosmWasm offers mathematical primitives for, you guessed it, mathematical operations. In contrast to
10-
the Rust standard library, which is limited to 128 bit integers, we offer integers that exceed that
11-
precision.
10+
the Rust standard library, which is limited to 128 bit integers, we offer [integers] that exceed
11+
that precision. Also [decimals] for fixed point math are available.
12+
13+
## Conversions
14+
15+
The following overview shows how to convert between integers and decimals of different size. This
16+
only shows the unsigned case but the signed types work the same way.
17+
18+
![Integer decimal conversions overview](/diagrams/integer-decimal-conversions.png)
19+
20+
<>
21+
{/* The diagram is maintained in Simon's personal Google account
22+
https://drive.google.com/file/d/17NQHkUTOgmFcxE8_DcH3yFlAw-mQjyG8/view?usp=sharing */}
23+
</>
24+
25+
`From`/`TryFrom` refer to the
26+
[Rust trait implementations](https://doc.rust-lang.org/rust-by-example/conversion/from_into.html).
27+
`::to_*` are functions on the source type and `::new`/`::from_*` are functions on the destination
28+
type.
29+
30+
[integers]: ./math/integers
31+
[decimals]: ./math/decimals

0 commit comments

Comments
 (0)