about summary refs log tree commit diff
path: root/src/libextra/num/rational.rs
AgeCommit message (Collapse)AuthorLines
2014-02-11Factoring bigint, rational, and complex out of libextra into libnum.Felix S. Klock II-682/+0
Removed use of globs present in earlier versions of modules. Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
2014-01-17Add a generic power functionFlavio Percoco-6/+6
The patch adds a `pow` function for types implementing `One`, `Mul` and `Clone` trait. The patch also renames f32 and f64 pow into powf in order to still have a way to easily have float powers. It uses llvms intrinsics. The pow implementation for all num types uses the exponentiation by square. Fixes bug #11499
2014-01-09Merge some numeric traits with Real and don't re-export RealExtBrendan Zabarauskas-7/+6
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
2013-12-30Implement Ratio:from_float()Volker Mische-1/+60
The Ratio::from_float() converts a float (f32 and f64) into a Ratio<BigInt>. Closes #9838
2013-12-08Remove dead codesKiet Tran-1/+1
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-8/+8
`librustuv`.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-2/+2
2013-10-24extra: Add getter methods to extra::rational::Ratiogifnksm-0/+66
After merging 0ada7c7, user code have not been able to access to `Ratio`'s numerator and denominator fields. In some algorithms, it is needed to get an rational number's numerator or denominator, but keeping these fields private is necessary for guaranteeing that `Ratio` numbers are irreducible. So, I added the getter methods `numer()` and `denom()`. As a bonus, this commit adds utility methods relating to the ratio-integer conversion.
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-1/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-2/+3
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-1/+1
Who doesn't like a massive renaming?
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-3/+3
2013-09-30extra: Remove usage of fmt!Alex Crichton-3/+3
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-4/+4
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-9/+20
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-23Fix some impls such that all supertraits are actually implemented.Michael Sullivan-0/+19
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-7/+5
2013-06-23vec: remove BaseIter implementationDaniel Micay-2/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-5/+5
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-10std: replace str::each_split* with an iteratorHuon Wilson-12/+3
2013-05-30libextra: Require documentation by defaultAlex Crichton-2/+2
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-1/+4
2013-05-22test: Update tests and import the prelude in some more places.Patrick Walton-0/+2
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+531
This only changes the directory names; it does not change the "real" metadata names.