Permalink
Browse files

Add `{Integer,Natural}/toDouble` (#10)

I had forgotten to mirror these to the official Prelude when I added them to
the Prelude used by the Haskell implementation
  • Loading branch information...
Gabriel439 committed Sep 10, 2018
1 parent 0c83aed commit 4e565d6ed6a5bcb5a8afe1f6829fec59cf34f829
Showing with 28 additions and 0 deletions.
  1. +12 −0 Integer/toDouble
  2. +16 −0 Natural/toDouble
View
@@ -0,0 +1,12 @@
{-
Convert an `Integer` to the corresponding `Double`
Examples:
```
./toDouble -3 = -3.0
./toDouble +2 = 2.0
```
-}
let toDouble : Integer → Double = Integer/toDouble in toDouble
View
@@ -0,0 +1,16 @@
{-
Convert a `Natural` number to the corresponding `Double`
Examples:
```
./toDouble 3 = 3.0
./toDouble 0 = 0.0
```
-}
let toDouble
: Natural → Double
= λ(n : Natural) → Integer/toDouble (Natural/toInteger n)
in toDouble

0 comments on commit 4e565d6

Please sign in to comment.