Skip to content

Commit a938279

Browse files
authored
Merge pull request #1 from garyb/precise
Precise
2 parents f34f19d + 4e524ab commit a938279

File tree

8 files changed

+137
-132
lines changed

8 files changed

+137
-132
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
/.*
2+
!/.gitignore
3+
!/.travis.yml
14
/bower_components/
25
/node_modules/
3-
/.pulp-cache/
46
/output/
5-
/.psci*
6-
/src/.webpack.js
7-
tmp/

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js:
5-
- stable
4+
node_js: stable
65
install:
7-
- npm install purescript pulp bower -g
8-
- bower install
6+
- npm install -g bower
7+
- npm install
98
script:
10-
- pulp build && pulp test
9+
- bower install --production
10+
- npm run -s build
11+
- bower install
12+
- npm -s test
13+
after_success:
14+
- >-
15+
test $TRAVIS_TAG &&
16+
echo $GITHUB_TOKEN | pulp login &&
17+
echo y | pulp publish --no-push

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# purescript-hugenums [![Build Status](https://travis-ci.org/Thimoteus/purescript-hugenums.svg?branch=master)](https://travis-ci.org/Thimoteus/purescript-hugenums)
1+
# purescript-precise
2+
3+
[![Latest release](http://img.shields.io/github/release/purescript-contrib/purescript-precise.svg)](https://github.com/purescript-contrib/purescript-precise/releases)
4+
[![Build status](https://travis-ci.org/purescript-contrib/purescript-precise.svg?branch=master)](https://travis-ci.org/purescript-contrib/purescript-precise)
25

36
This is a library for working with numbers of arbitrarily finite size.
47

5-
Javascript (and to some extension Purescript) has quite a few drawbacks when it comes to large numbers. For example, Purescript's `Int` primitive [is a member](https://github.com/purescript/purescript-prelude/blob/v0.1.3/src/Prelude.js#L177-L178) of the `Bounded` typeclass, with `top == 2 ^ 31 - 1` and `bottom == - (2 ^ 32)`.
8+
JavaScript (and to some extension PureScript) has quite a few drawbacks when it comes to large numbers. For example, PureScript's `Int` primitive [is a member](https://github.com/purescript/purescript-prelude/blob/v0.1.3/src/Prelude.js#L177-L178) of the `Bounded` typeclass, with `top == 2 ^ 31 - 1` and `bottom == - (2 ^ 32)`.
69

7-
The Purescript `Number` primitive is not `Bounded` in the same way; however, there are problems with manipulating large-enough `Number`s:
10+
The PureScript `Number` primitive is not `Bounded` in the same way; however, there are problems with manipulating large-enough `Number`s:
811

912
```
1013
> import Prelude
@@ -33,14 +36,12 @@ HugeNum 900000000000000001.0
3336

3437
Addition is implemented using an elementary-school method. Multiplication follows [Karatsuba](https://en.wikipedia.org/wiki/Karatsuba_algorithm).
3538

36-
## documentation
37-
38-
Available on [pursuit](https://pursuit.purescript.org/packages/purescript-hugenums/).
39-
40-
## integers
39+
## Installation
4140

42-
There is also a newtype for integral values in `Data.HugeInt`.
41+
```
42+
bower install purescript-precise
43+
```
4344

44-
## installation
45+
## Documentation
4546

46-
`bower install purescript-hugenums`
47+
Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-precise/).

bower.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"name": "purescript-hugenums",
3-
"version": "2.0.1",
4-
"moduleType": [
5-
"node"
6-
],
2+
"name": "purescript-precise",
73
"license": "MIT",
84
"ignore": [
95
"**/.*",
@@ -13,19 +9,16 @@
139
],
1410
"repository": {
1511
"type": "git",
16-
"url": "git://github.com/Thimoteus/purescript-hugenums.git"
12+
"url": "git://github.com/purescript-contrib/purescript-hugenums.git"
1713
},
1814
"dependencies": {
19-
"purescript-arrays": "^1.0.0",
20-
"purescript-strings": "^1.0.0",
21-
"purescript-globals": "^1.0.0",
22-
"purescript-integers": "^1.0.0",
23-
"purescript-quickcheck": "~1.0.0"
15+
"purescript-arrays": "^3.0.0",
16+
"purescript-globals": "^2.0.0",
17+
"purescript-integers": "^2.0.0",
18+
"purescript-quickcheck": "^3.0.0",
19+
"purescript-strings": "^2.0.2"
2420
},
2521
"devDependencies": {
26-
"purescript-debugger": "~1.0.0",
27-
"purescript-test-unit": "~7.0.0",
28-
"purescript-quickcheck-laws": "~1.0.0",
29-
"purescript-benchotron": "~4.0.0"
22+
"purescript-quickcheck-laws": "^2.0.0"
3023
}
3124
}

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "pulp build --censor-lib --strict",
6+
"test": "pulp test"
7+
},
8+
"devDependencies": {
9+
"pulp": "^9.0.1",
10+
"purescript-psa": "^0.3.9",
11+
"purescript": "^0.10.1",
12+
"rimraf": "^2.5.4"
13+
}
14+
}

src/Data/Digit.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Data.Digit
55
, _zero, _one, _two, _three, _four, _five, _six, _seven, _eight, _nine
66
) where
77

8-
import Prelude (class Ord, class Eq, class Show, (+), (-), ($), (<=), (&&), (>=), otherwise, compare, (==), show, (<>))
8+
import Prelude
99
import Data.Maybe (Maybe(..))
1010
import Data.Char (toCharCode, fromCharCode)
1111

src/Data/HugeInt.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Data.String (length, drop, takeWhile)
2222
import Data.Int (toNumber)
2323
import Data.Int (round) as Int
2424
import Data.Maybe (Maybe(..))
25-
import Data.HugeNum (HugeNum())
25+
import Data.HugeNum (HugeNum)
2626
import Data.HugeNum as HN
2727

2828
newtype HugeInt = HugeInt HugeNum

0 commit comments

Comments
 (0)