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

Add {Integer,Natural}/toDouble #10

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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