Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Commit

Permalink
Add {Integer,Natural}/toDouble (#10)
Browse files Browse the repository at this point in the history
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
Gabriella439 authored Sep 10, 2018
1 parent 0c83aed commit 4e565d6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Integer/toDouble
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions Natural/toDouble
Original file line number Diff line number Diff line change
@@ -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.