Skip to content

Commit

Permalink
Financial math lesson.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucanicoladebiasi committed Oct 24, 2024
1 parent dda861b commit 5278e92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/1.Hello_World/FinancialMath.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ for (let i = 0; i <= n; i++) {
x = FixedPointNumber.of(i).dp(fd).sqrt();
a = BigNumber(i).dp(fd).sqrt();
rows.push({
'JS': Math.sqrt(i),
'JS number': Math.sqrt(i),
'BigNumber': `${a}`,
'SDK FixedPointNumber': `${x}`
})
Expand All @@ -272,7 +272,7 @@ The code prints the table

```text
┌─────────┬────────────────────┬──────────────────────────┬──────────────────────────┐
│ (index) │ JS │ BigNumber │ SDK FixedPointNumber │
│ (index) │ JS number │ BigNumber │ SDK FixedPointNumber │
├─────────┼────────────────────┼──────────────────────────┼──────────────────────────┤
│ 0 │ 0 │ '0' │ '0' │
│ 1 │ 1 │ '1' │ '1' │
Expand Down Expand Up @@ -305,7 +305,7 @@ for (let i = 0; i <= n; i++) {
x = FixedPointNumber.of(i).dp(fd).sqrt();
a = BigNumber(i).dp(fd).sqrt();
rows.push({
'JS': Math.sqrt(i),
'JS number': Math.sqrt(i),
'BigNumber': `${a}`,
'SDK FixedPointNumber': `${x}`
})
Expand All @@ -317,7 +317,7 @@ prints

```text
┌─────────┬────────────────────┬──────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ JS │ BigNumber │ SDK FixedPointNumber │
│ (index) │ JS number │ BigNumber │ SDK FixedPointNumber │
├─────────┼────────────────────┼──────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────┤
│ 0 │ 0 │ '0' │ '0' │
│ 1 │ 1 │ '1' │ '1' │
Expand Down
4 changes: 2 additions & 2 deletions src/1.Hello_World/FinancialMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ for (let i = 0; i <= n; i++) {
x = FixedPointNumber.of(i).dp(fd).sqrt();
a = BigNumber(i).dp(fd).sqrt();
rows.push({
'JS': Math.sqrt(i),
'JS number': Math.sqrt(i),
'BigNumber': `${a}`,
'SDK FixedPointNumber': `${x}`
})
Expand All @@ -64,7 +64,7 @@ for (let i = 0; i <= n; i++) {
x = FixedPointNumber.of(i).dp(fd).sqrt();
a = BigNumber(i).dp(fd).sqrt();
rows.push({
'JS': Math.sqrt(i),
'JS number': Math.sqrt(i),
'BigNumber': `${a}`,
'SDK FixedPointNumber': `${x}`
})
Expand Down

0 comments on commit 5278e92

Please sign in to comment.