Commit Graph

509 Commits

Author SHA1 Message Date
Trevor Spiteri b035ae9dbe typo 2020-04-08 12:51:11 +02:00
Trevor Spiteri 8803e0786d docs: link to F::is_{finite,nan} in impl {To,From}Fixed for F
Before this commit, all links were to the f64 documentation, even for
implementations for f32, f16 and bf16.
2020-03-20 01:59:51 +01:00
Trevor Spiteri f86e59a204 document individual conversion traits 2020-03-05 15:30:08 +01:00
Trevor Spiteri aeac17c0d8 fix failing cmp_parse test
While with the actual string

    f ≤ string < f+Δ

we are using a parsed version, which could be actually larger than
string so that the test should only check

    f ≤ parsed ≤ f+Δ
2020-02-24 14:29:34 +01:00
Trevor Spiteri c6d8e14537 test that constants are truncated version of known correct strings 2020-02-24 14:16:23 +01:00
Trevor Spiteri 327bc05413 specify that <Err = PraseFixedError> in Fixed: FromStr constraint 2020-02-24 14:13:30 +01:00
Trevor Spiteri 524fc0c28f version 0.5.4 2020-02-21 16:34:27 +01:00
Trevor Spiteri 97fdf52ac6 silence clippy 2020-02-21 15:57:56 +01:00
Trevor Spiteri e0f3eb77b8 fix incorrect overflow handling for rem_euclid_int 2020-02-21 15:39:02 +01:00
Trevor Spiteri e8f5a8238e tweak Fixed doc 2020-02-13 15:57:12 +01:00
Trevor Spiteri 5ed4979048 version 0.5.3 2020-02-13 13:48:03 +01:00
Trevor Spiteri 26da6f43bf ci: sort list of cargo cached packages 2020-02-13 13:47:11 +01:00
Trevor Spiteri 4b889cbb1f reorganize {,checked} {,Euclidean} remainders {,by integers}
Now the main logic is in the checked functions, which fail only if rhs
is zero, and the other functions all .expect("division by zero").

checked_rem now uses % instead of core checked_rem.

checked_rem_euclid now uses core rem_euclid.

checked_rem_int uses checked_rem for the most common case.

checked_rem_euclid_int uses checked_rem_euclid for the most common
case.
2020-02-13 12:04:49 +01:00
Trevor Spiteri 68f72f8b56 some fixes and tests
* rem_euclid no longer uses rhs.abs() which could overflow.

  * Rem<Inner> and rem_euclid_int now allow for the signed case where
    rhs is equal to the absolute value of the minimum fixed value.

  * checked_rem_int, checked_rem_euclid and checked_rem_euclid_int now
    check for zero then defer to Rem<Inner>, rem_euclid and
    rem_euclid_int.
2020-02-13 01:39:02 +01:00
Trevor Spiteri 913ea21d4d typo 2020-02-13 00:07:53 +01:00
Trevor Spiteri be49c12e93 typo 2020-02-12 23:58:44 +01:00
Trevor Spiteri 137d8989e6 mention fixed-sqrt in top-level doc 2020-02-12 23:56:26 +01:00
Trevor Spiteri e3e17341f2 add {div,rem}_euclid_int to Wrapping 2020-02-12 23:51:31 +01:00
Trevor Spiteri 873bdfa128 fix bug in round_to_zero 2020-02-12 23:45:58 +01:00
Trevor Spiteri ddf69cdca0 some doc tweaks 2020-02-12 23:18:24 +01:00
Trevor Spiteri 3ee5811556 fix remaining checked {div,rem}_euclid_int methods
Closes https://gitlab.com/tspiteri/fixed/issues/13
2020-02-12 18:40:04 +01:00
Trevor Spiteri 97128d2b9f fix checked_rem_int and fix+deprecate {wrapping,overflowing}_rem_int
https://gitlab.com/tspiteri/fixed/issues/13
2020-02-12 17:32:34 +01:00
Trevor Spiteri 677ee97f6f add more arithmetic tests 2020-02-12 16:59:10 +01:00
Trevor Spiteri f8d2004c8f fix Rem<Inner> for Fixed
https://gitlab.com/tspiteri/fixed/issues/13
2020-02-12 16:58:21 +01:00
Trevor Spiteri f070f5e75a more of remove Frac constraints for trait impls that do not need it 2020-02-12 16:44:26 +01:00
Trevor Spiteri f6f4b9d174 add {div,rem}_euclid to Wrapping 2020-02-12 15:07:15 +01:00
Trevor Spiteri bf7c2024e1 add {saturating,wrapping,overflowing}_div_euclid 2020-02-12 14:48:10 +01:00
Trevor Spiteri 43926daa62 add checked_{div,rem}_euclid 2020-02-12 14:16:19 +01:00
Trevor Spiteri 96e922d287 remove Frac constraints for trait impls that do not need it 2020-02-12 13:57:20 +01:00
Trevor Spiteri 6e93affa0d add div_euclid and rem_euclid 2020-02-12 13:48:35 +01:00
Trevor Spiteri c2fa7448c2 implement Rem and RemAssign, and add checked_rem
Closes https://gitlab.com/tspiteri/fixed/issues/12
2020-02-12 13:15:23 +01:00
Trevor Spiteri 2f2b05e33f version 0.5.2 2020-02-02 21:02:14 +01:00
Trevor Spiteri fc045ae224 Merge branch 'serdeize-wrapping' into 'master'
add serde impls for Wrapping types

See merge request tspiteri/fixed!5
2020-02-01 11:52:33 +00:00
Shane Pearman b0e3828e79 re-use inner serde impls for Wrapping types 2020-02-01 03:01:11 -08:00
Shane Pearman 7aa5b0844f add serde impls for Wrapping types 2020-02-01 01:26:35 -08:00
Trevor Spiteri 2ec4c749be appveyor can't handle % 2019-12-31 18:08:29 +01:00
Trevor Spiteri f5c92ec15b ci: appveyor typo 2019-12-31 17:32:43 +01:00
Trevor Spiteri 513a27c343 ci: remove unused .crate files before caching 2019-12-31 17:30:28 +01:00
Trevor Spiteri c6e9ecbfb1 ci: rustup toolchain install --profile minimal 2019-12-31 17:24:36 +01:00
Trevor Spiteri ab0aa534c7 version 0.5.1 2019-12-23 18:15:31 +01:00
Trevor Spiteri 823916346f add std feature 2019-12-23 17:39:41 +01:00
Trevor Spiteri 59bc0bfd26 link to core libs instead of std libs where possible 2019-12-23 17:22:21 +01:00
Trevor Spiteri be35c826da simplify overflow checks for multiplication and division 2019-12-07 22:40:09 +01:00
Trevor Spiteri 950f9051f7 version 0.5.0 2019-12-06 11:46:41 +01:00
Trevor Spiteri ae0b037bc5 fmt 2019-11-24 21:17:19 +01:00
Trevor Spiteri 1daef22823 list new methods in release notes 2019-11-24 20:20:46 +01:00
Trevor Spiteri 68b2190a86 add conversions to/from {be,le,ne}_bytes 2019-11-24 20:13:26 +01:00
Trevor Spiteri aac0353bb1 cleaner is_power_of_two 2019-11-24 18:53:45 +01:00
Trevor Spiteri e46bf604f3 remove deprecated methods and modules 2019-11-24 18:53:07 +01:00
Trevor Spiteri 25510f1525 use std abs, wrapping_abs, overflowing_abs 2019-11-24 18:52:57 +01:00