Go to file
Homu ccdf307cee Auto merge of #220 - IvanUkhov:constant, r=cuviper
Add a trait for floating-point constants

The pull request is to address issue #194. In order to keep the library organized, I’ve introduced a new trait for the new functionality. The trait is supposed to closely follows the [`consts`](https://doc.rust-lang.org/std/f64/consts/index.html) module from the standard library. There are at least the following three open questions:

1. What should the name of the trait be? Currently, it’s `Constant`; an alternative is `Consts`.
2. What should the names of the getters be? Currently, they are lower-case versions of the constants defined in the `consts` module. Note that `Float` provides `log2` and `log10`, whereas `LOG_2` and `LOG_10` get translated into `log_2` and `log_10`, respectively.
3. Should `Float` require the new trait? Or should it be left up to the user?

Please let me know what you think. Thank you!

Regards,
Ivan
2016-08-16 10:29:20 +09:00
.travis test_features.sh: re-enable as a simple build 2016-03-25 18:30:27 -07:00
benches bigint: allow `Sub` to work in-place on the RHS 2016-07-08 17:34:12 -07:00
bigint bigint: inline bits() methods 2016-08-10 22:23:28 -07:00
complex complex: bump to 0.1.33 2016-07-12 01:10:37 -07:00
doc Update repo and doc links 2015-11-12 18:40:13 -08:00
integer integer: add path-dependency versions 2016-04-14 00:25:51 -07:00
iter iter: add path-dependency versions 2016-04-14 00:37:04 -07:00
macros macros: bump to 0.1.33 2016-05-18 16:28:32 -07:00
rational rational: small additional tweaks 2016-07-24 14:58:43 -04:00
src Move functions remaining in num to num-traits 2016-05-13 10:38:14 +02:00
traits Add a trait for floating-point constants 2016-08-15 06:38:08 +02:00
.gitignore Update num-macros to Rust master 2015-05-14 10:19:47 -07:00
.rustup.sh Move .multirust.sh to .rustup.sh 2016-07-12 00:34:27 -07:00
.travis.yml .travis.yml: add a verbose build 2016-03-25 18:30:27 -07:00
Cargo.toml num: require newer traits for moved functions, fixes #206 2016-07-12 23:24:45 -07:00
LICENSE-APACHE Initial seeding from rust repo 2014-09-16 10:35:35 -07:00
LICENSE-MIT Initial seeding from rust repo 2014-09-16 10:35:35 -07:00
Makefile Makefile: add complex and iter 2016-03-25 17:50:51 -07:00
README.md Update intros to better reflect the breadth of num 2015-11-21 16:39:00 -08:00

README.md

num

A collection of numeric types and traits for Rust.

This includes new types for big integers, rationals, and complex numbers, new traits for generic programming on numeric properties like `Integer, and generic range iterators.

Documentation

Usage

Add this to your Cargo.toml:

[dependencies]
num = "0.1"

and this to your crate root:

extern crate num;