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 5278e92 commit 29be336
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/1.Hello_World/FinancialMath.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ arguments.
r = x.div(FixedPointNumber.ZERO);
console.log(`${x}/0 = ${r}`);
r = x.div(FixedPointNumber.of(Infinity));
console.log(`${x}/infinity = ${r}`);
console.log(`${x}/Infinity = ${r}`);
r = x.div(FixedPointNumber.ZERO.div(FixedPointNumber.ZERO));
console.log(`0/0 = ${r}`);
```
Expand All @@ -358,7 +358,7 @@ Whatever is the last value of `x`, the code prints

```text
2.82842712474619009760337744841939615713934375075389614635335947598146495692421407/0 = Infinity
2.82842712474619009760337744841939615713934375075389614635335947598146495692421407/infinity = 0
2.82842712474619009760337744841939615713934375075389614635335947598146495692421407/Infinity = 0
0/0 = NaN
```

Expand Down
2 changes: 1 addition & 1 deletion src/1.Hello_World/FinancialMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ console.table(rows);
r = x.div(FixedPointNumber.ZERO);
console.log(`${x}/0 = ${r}`);
r = x.div(FixedPointNumber.of(Infinity));
console.log(`${x}/infinity = ${r}`);
console.log(`${x}/Infinity = ${r}`);
r = x.div(FixedPointNumber.ZERO.div(FixedPointNumber.ZERO));
console.log(`0/0 = ${r}`);

Expand Down

0 comments on commit 29be336

Please sign in to comment.