- 30 4月, 2013 30 次提交
-
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 bors 提交于
#6086
-
由 bors 提交于
`std::bigint` contains the following code. ```rust borrow = *elem << (uint::bits - n_bits); ``` The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand, because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture. If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`, but if --opt-level is given, `borrow` is always zero. I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug, but the unittest passes normally.) This pull request also removes the implicit vector copies in `bigint.rs`.
-
由 bors 提交于
r? @brson This hopefully addresses your concerns about the termination condition, and adds more tests. With a bonus documentation commit.
-
由 bors 提交于
This replaces the wrapper around the runtime RNG with a pure Rust implementation of the same algorithm. This is much faster (up to 5x), and is hopefully safer. There is still (a little) room for optimisation: testing by summing 100,000,000 random `u32`s indicates this is about ~~40-50%~~ 10% slower than the pure C implementation (running as standalone executable, not in the runtime). (Only 6d50d55 is part of this PR, the first two are from #6058, but are required for the rt rng to be correct to compare against in the tests.)
-
由 Luqman Aden 提交于
-
由 Luqman Aden 提交于
-
由 Huon Wilson 提交于
-
由 Huon Wilson 提交于
This replaces the wrapper around the runtime RNG with a pure Rust implementation of the same algorithm. This is faster (up to 5x), and is hopefully safer. There is still much room for optimisation: testing by summing 100,000,000 random `u32`s indicates this is about 40-50% slower than the pure C implementation (running as standalone executable, not in the runtime).
-
由 bors 提交于
r? @brson
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
This commit does not remove `ty::arg`, although that should be possible to do now.
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Tim Chevalier 提交于
This reverts commit 9860fe10.
-
由 bors 提交于
As discussed on issue #4819, I have created four new traits: `Algebraic`, `Trigonometric`, `Exponential` and `Hyperbolic`, and moved the appropriate methods into them from `Real`. ~~~rust pub trait Algebraic { fn pow(&self, n: Self) -> Self; fn sqrt(&self) -> Self; fn rsqrt(&self) -> Self; fn cbrt(&self) -> Self; fn hypot(&self, other: Self) -> Self; } pub trait Trigonometric { fn sin(&self) -> Self; fn cos(&self) -> Self; fn tan(&self) -> Self; fn asin(&self) -> Self; fn acos(&self) -> Self; fn atan(&self) -> Self; fn atan2(&self, other: Self) -> Self; } pub trait Exponential { fn exp(&self) -> Self; fn exp2(&self) -> Self; fn expm1(&self) -> Self; fn log(&self) -> Self; fn log2(&self) -> Self; fn log10(&self) -> Self; } pub trait Hyperbolic: Exponential { fn sinh(&self) -> Self; fn cosh(&self) -> Self; fn tanh(&self) -> Self; } ~~~ There was some discussion over whether we should shorten the names, for example `Trig` and `Exp`. No abbreviations have been agreed on yet, but this could be considered in the future. Additionally, `Integer::divisible_by` has been renamed to `Integer::is_multiple_of`.
-
由 bors 提交于
One of the tests seems to have no current equivalent that's similar. Please let me know if that's incorrect, and I'll try fixing it instead of deleting it. I suppose a struct could be used instead of `any` and `match type`, but it seems like the original intent of the test was to exercise `match type`
-
- 29 4月, 2013 10 次提交
-
-
由 Brendan Zabarauskas 提交于
After discussions on IRC and #4819, we have decided to revert this change. This is due to the traits expressing different ideas and because hyperbolic functions are not trivially implementable from exponential functions for floating-point types.
-
由 Brendan Zabarauskas 提交于
The Hyperbolic Functions are trivially implemented in terms of `exp`, so it's simpler to group them the Exponential trait. In the future these would have default implementations.
-
由 ILYONG CHO 提交于
-
由 ILYONG CHO 提交于
-
由 bors 提交于
r? @pcwalton A month's worth of parser cleanup here. Much of this is new comments and renaming. A number of these commits also remove unneeded code. Probably the biggest refactor here is splitting "parse_item_or_view_item" into two functions; it turns out that the only overlap between items in foreign modules and items in regular modules was macros, so this refactor should make things substantially easier for future maintenance.
-
由 Brendan Zabarauskas 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 Brendan Zabarauskas 提交于
-
由 Brendan Zabarauskas 提交于
Move appropriate functions out of Real and into separate Algebraic, Trigonometric, Exponential and Hyperbolic traits
-