GitXplorerGitXplorer
r

bigmath

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
1240622162c87f69c7361253e4223661577701b1

Fix pow(x, 0).

rrandymarsh77 committed 7 years ago
Unverified
d39ecaff87afc36c22a8e3c426f39e9622422892

Add simple precision expansion for multiplication.

rrandymarsh77 committed 7 years ago
Unverified
6e70c7bf81b9b062c175b8ef2a71caff41a2c736

Make precision of pow result more accurate.

rrandymarsh77 committed 7 years ago
Unverified
d93505e19f7eb7eadb5ef03670aff52665dfa2d9

Add conversions.

rrandymarsh77 committed 7 years ago
Unverified
cd1c2cb7b8ecd6434efa4e938db6e90f3b837bab

Expand precision when powering up.

rrandymarsh77 committed 7 years ago
Unverified
61221d7d36d379b1cc8d5dd7aa99c5ccee026231

Initialize string data with enough precision.

rrandymarsh77 committed 7 years ago

README

The README file for this repository.

BigMath

Swift native numerics for arbitrary precision using MPFR and GMP

Why?

I recently tried to work on a project that required arbitrary precision types. I was hard pressed to find a desirable solution for floating point types, and even had limited success with integer types. Forget about easily working with and converting between both types. Luckily, Swift has an extremely robust protocol hierarchy for declaring new numeric types. And, there are some mature, fully featured, C libraries to handle this kind of thing. The goal is to work with arbitary precision as effortlessy as computing with doubles and ints.

Disclaimer

Probably throws a lot of NotImplemented errors.

Usage

import BigMath

let x: BigFloat = 1
let y: BigFloat = 2
let z = x * y
print(z.render(.base10))

Contributing and Development

Implementations should be filled in as needed. The goal is to be test-driven. Currently needs more robust tests.

License

MPFR and GMP are licensed under GPL. This project carries that licesnse, and adds an additional MIT if that's legal.