about summary refs log tree commit diff
path: root/src/libcore/num
AgeCommit message (Collapse)AuthorLines
2013-02-03Fixed errors resulting from rebase.Marvin Löbel-25/+26
2013-02-03Fixed `fmt!`, tests, doc-tests.Marvin Löbel-1/+7
2013-02-03Removed wrong/wip docMarvin Löbel-4/+0
2013-02-03Converted the floating point types to the new string conversion functions.Marvin Löbel-206/+609
Also fixed all conflicting calls of the old functions in the rest of the codebase. The set of string conversion functions for each float type now consists of those items: - to_str(), converts to number in base 10 - to_str_hex(), converts to number in base 16 - to_str_radix(), converts to number in given radix - to_str_exact(), converts to number in base 10 with a exact number of trailing digits - to_str_digits(), converts to number in base 10 with a maximum number of trailing digits - implementations for to_str::ToStr and num::ToStrRadix - from_str(), parses a string as number in base 10 including decimal exponent and special values - from_str_hex(), parses a string as a number in base 16 including binary exponent and special values - from_str_radix(), parses a string as a number in a given base excluding any exponent and special values - implementations for from_str::FromStr and num::FromStrRadix
2013-02-03Fixed tests still using old integer to_strMarvin Löbel-11/+33
Fixed integer tests
2013-02-03Converted libcore/uint-template.rs to the new string functions.Marvin Löbel-117/+137
- Moved ToStr implementation of unsigned integers to uint-template.rs. - Marked the `str()` function as deprecated. - Forwarded all conversion functions to `core::num::to_str_common()` and `core::num::from_str_common()`. - Fixed most places in the codebase where `to_str()` is being used. - Added uint-template to_str and from_str overflow tests.
2013-02-03Converted libcore/int-template.rs to the new string functions.Marvin Löbel-52/+126
- Moved ToStr implementation of integers to int-template.rs. - Marked the `str()` function as deprecated. - Forwarded all conversion functions to `core::num::to_str_common()` and `core::num::from_str_common()`. - Fixed most places in the codebase where `to_str()` is being used. - Added int-template to_str and from_str overflow tests.
2013-02-03Added generic string <-> number conversion functions to core::num.Marvin Löbel-3/+537
They unify the different implementations that exists in int-template.rs, uint-template.rs and float.rs into one pair of functions, which are also in principle usable for anything that implements the necessary numeric traits. Their usage is somewhat complex due to the large amount of arguments each one takes, but as they're not meant to be used directly that shouldn't be a problem.
2013-02-03Added some generic number functions to core::numMarvin Löbel-0/+89
Also fixes previous commit not compiling due to not finding Option.
2013-02-03Added ToStrRadix and FromStrRadix traitsMarvin Löbel-0/+10
2013-02-03Added Round trait to coreMarvin Löbel-0/+126
2013-02-03Moved all numeric modules in core into own directoryMarvin Löbel-0/+2759
Reason: Better grouping of related modules, future-proving for a more extensive math library.