rust/src/libstd
kennytm 63531f515d
Rollup merge of #50342 - fkjogu:euclidean, r=BurntSushi
Document round-off error in `.mod_euc()`-method, see issue #50179

Due to a round-off error the method `.mod_euc()` of both `f32` and `f64` can produce mathematical invalid outputs. If `self` in magnitude is much small than the modulus `rhs` and negative, `self + rhs` in the first branch cannot be represented in the given precision and results into `rhs`. In the mathematical strict sense, this breaks the definition. But given the limitation of floating point arithmetic it can be thought of the closest representable value to the true result, although it is not strictly in the domain `[0.0, rhs)` of the function. It is rather the left side asymptotical limit. It would be desirable that it produces the mathematical more sound approximation of `0.0`, the right side asymptotical limit. But this breaks the property, that `self == self.div_euc(rhs) * rhs + a.mod_euc(rhs)`.

The discussion in issue #50179 did not find an satisfying conclusion to which property is deemed more important. But at least we can document the behaviour. Which this pull request does.
2018-06-28 06:15:38 +08:00
..
collections Auto merge of #51543 - SimonSapin:oom, r=SimonSapin 2018-06-19 19:22:12 +00:00
ffi Rollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton 2018-05-17 05:22:07 +08:00
io Remove erroneous example of main as a non-Result function. 2018-06-19 18:32:44 -04:00
net Remove the deprecated std::net::{lookup_host,LookupHost} 2018-05-03 16:24:21 -07:00
os Add doc links to std::os extension traits 2018-04-14 15:32:24 -07:00
prelude Revert "Add TryFrom and TryInto to the prelude" 2018-03-30 15:54:05 +02:00
sync libstd: add an RAII utility for sys_common::mutex::Mutex 2018-06-17 15:18:32 +08:00
sys [fuchsia] Update zx_cprng_draw to target semantics 2018-06-27 08:56:19 -07:00
sys_common migrate codebase to ..= inclusive range patterns 2018-06-26 07:53:30 -07:00
tests Update Cargo submodule 2018-03-11 10:59:28 -07:00
thread libstd: add an RAII utility for sys_common::mutex::Mutex 2018-06-17 15:18:32 +08:00
alloc.rs Rename OOM to allocation error 2018-06-18 21:41:24 +02:00
ascii.rs Deprecate the AsciiExt trait in favor of inherent methods 2018-03-21 17:54:33 +01:00
build.rs [fuchsia] Migrate from launchpad to fdio_spawn_etc 2018-06-07 09:22:59 -07:00
Cargo.toml Replace libbacktrace with a submodule 2018-05-30 05:58:23 -07:00
env.rs env: remove unwrap in examples in favor of try op 2018-05-14 12:56:18 +02:00
error.rs Remove deprecated heap modules 2018-06-11 13:47:27 -07:00
f32.rs Clarify rational behind current implementation of .mod_euc() 2018-06-26 13:09:56 +02:00
f64.rs Clarify rational behind current implementation of .mod_euc() 2018-06-26 13:09:56 +02:00
fs.rs Remove feature flag from fs::read_to_string example 2018-06-01 08:24:36 -04:00
future.rs PinMut: Add safe get_mut and rename unsafe fns to get_mut_unchecked and map_unchecked 2018-06-23 18:29:56 +02:00
keyword_docs.rs Add doc for fn keyword 2018-06-15 23:23:11 +02:00
lib.rs Review nits and updates 2018-06-22 11:36:01 -07:00
macros.rs Add sentence to compile_error!() docs 2018-06-25 10:34:00 +02:00
memchr.rs Fix inconsistent doc headings 2017-08-24 18:42:53 +02:00
num.rs Stabilize num::NonZeroU* 2018-05-16 19:11:31 +02:00
panic.rs PinMut: Add safe get_mut and rename unsafe fns to get_mut_unchecked and map_unchecked 2018-06-23 18:29:56 +02:00
panicking.rs remove #[unwind(allowed)] 2018-06-03 13:46:19 +02:00
path.rs Stabilize std::path::Path:ancestors 2018-06-18 19:49:45 +02:00
primitive_docs.rs make std::str link into See also link 2018-05-09 18:30:32 -04:00
process.rs Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum 2018-04-24 11:56:59 +08:00
rt.rs Address review comments 2018-03-19 11:41:28 +09:00
time.rs Stabilize SystemTime::UNIX_EPOCH 2018-05-28 18:24:01 -06:00