about summary refs log tree commit diff
path: root/src/libcore/fmt/float.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-207/+0
2020-03-05Document unsafe blocks in core::fmtPhoebe Bell-2/+4
2020-02-17Drop unused argument to float functionsMark Rousskov-2/+0
2019-11-26Format libcore with rustfmtDavid Tolnay-37/+86
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-11-06Have tidy ensure that we document all `unsafe` blocks in libcoreOliver Scherer-0/+2
2019-07-19do not use mem::uninitialized in std::ioRalf Jung-3/+4
2019-04-19libcore: deny more...Mazdak Farrokhzad-14/+14
2019-04-18libcore => 2018Taiki Endo-3/+3
2019-03-26adjust MaybeUninit API to discussionsRalf Jung-8/+8
uninitialized -> uninit into_initialized -> assume_init read_initialized -> read set -> write
2019-02-22avoid unnecessary use of MaybeUninit::get_ref, and expand comment on the othersRalf Jung-0/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-02let FIXME refer to tracking issueRalf Jung-1/+1
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+3
2018-11-23use MaybeUninit in core::fmtRalf Jung-13/+14
Code by @japaric, I just split it into individual commits
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-14/+13
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-22core: fix deprecated warningsJorge Aparicio-13/+14
2017-12-19Always print floats with a decimal point with the Debug formatterDiggory Blake-8/+9
2017-05-09fix confusion about parts required for float formattingNathan Froyd-4/+4
The documentation for flt2dec doesn't match up with the actual implementation, so fix the documentation to align with reality. Presumably due to the mismatch, the formatting code for floats in std::fmt can use correspondingly shorter arrays in some places, so fix those places up as well. Fixes #41304.
2017-04-28fmt: use mem::uninitialized for float formatting buffersNathan Froyd-22/+34
Spending time to initialize these is just wasted work, as we'll overwrite them soon anyway. Fixes #41259.
2017-04-28fmt: use the minimum parts array sizeNathan Froyd-4/+4
The comments for flt2dec::to_shortest_str says that we only need a slice of length 5 for the parts array. Initializing a 16-part array is just wasted effort and wasted stack space. Other functions in the flt2dec module have similar comments, so we adjust the parts arrays passed to those functions accordingly.
2017-04-28fmt: reduce the stack space required by float formattingNathan Froyd-16/+66
For the two major entry points for float formatting, we split the exact case and the shortest cases into separate functions. We mark the separate functions as #[inline(never) so the exact cases won't bloat stack space in their callers unnecessarily. The shortest cases are marked so for similar reasons. Fixes #41234.
2017-02-07Improve fmt floatSon-0/+94
* Move to a separate float mod * Add more tests for f64 f32 lower exp upper exp * Use assert_eq for a clearer error message
2015-05-06core: made the core formatter to use a new flt2dec.Kang Seonghoon-289/+0
As a side effect `core::fmt::float` is gone now. This also slightly changes the float output, so this is: [breaking-change]
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-14/+29
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-12Make Debug include the - in -0.0Robin Kruppe-91/+29
2015-04-10Fix for #23150Ben Ashford-1/+1
2015-03-30std: Standardize (input, output) param orderingsAlex Crichton-2/+2
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-28Remove IteratorExtSteven Fackler-1/+1
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-2/+2
Now that support has been removed, all lingering use cases are renamed.
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-3/+3
2015-03-03Rollup merge of #22876 - Florob:const, r=nikomatsakisManish Goregaokar-1/+1
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-02core: Audit num module for int/uintBrian Anderson-2/+2
* count_ones/zeros, trailing_ones/zeros return u32, not usize * rotate_left/right take u32, not usize * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize Doesn't touch pow because there's another PR for it. [breaking-change]
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-1/+1
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-02-23int audit - libcore::fmtNick Cameron-11/+11
2015-02-17Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonbors-1/+1
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-15Fix the falloutVadim Petrochenkov-5/+5
2015-02-14Rename `fmt::Writer` to `fmt::Write`Chris Wong-1/+1
This brings it in line with its namesake in `std::io`. [breaking-change]
2015-02-04remove all kind annotations from closuresJorge Aparicio-2/+2
2015-01-29remove unused importsJorge Aparicio-1/+1
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-1/+1
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-25Moving away from deprecated i/u suffixes in libcoreAlfie John-3/+3
2015-01-21Fallout from stabilization.Aaron Turon-2/+2
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-1/+1
2015-01-07use slicing sugarJorge Aparicio-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-2/+2
2015-01-05Rename `core::char::Char` to `CharExt` to match prelude guidelines.Huon Wilson-1/+1
Imports may need to be updated so this is a [breaking-change]
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-2/+2
2015-01-03core: merge DoubleEndedIteratorExt into IteratorExtJorge Aparicio-1/+1
2015-01-01std: Enforce Unicode in fmt::WriterAlex Crichton-10/+10
This commit is an implementation of [RFC 526][rfc] which is a change to alter the definition of the old `fmt::FormatWriter`. The new trait, renamed to `Writer`, now only exposes one method `write_str` in order to guarantee that all implementations of the formatting traits can only produce valid Unicode. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md One of the primary improvements of this patch is the performance of the `.to_string()` method by avoiding an almost-always redundant UTF-8 check. This is a breaking change due to the renaming of the trait as well as the loss of the `write` method, but migration paths should be relatively easy: * All usage of `write` should move to `write_str`. If truly binary data was being written in an implementation of `Show`, then it will need to use a different trait or an altogether different code path. * All usage of `write!` should continue to work as-is with no modifications. * All usage of `Show` where implementations just delegate to another should continue to work as-is. [breaking-change] Closes #20352
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-1/+1