Commit Graph

525 Commits

Author SHA1 Message Date
Trevor Spiteri b4064938d2 implement num_traits::mul_add::MulAdd 2020-09-22 16:41:41 +02:00
Trevor Spiteri 03436b19b5 typo 2020-09-22 15:47:29 +02:00
Trevor Spiteri a3d947776d add mul_add methods 2020-09-22 15:47:13 +02:00
Trevor Spiteri b53fb709bf fix compilation without unwrapped feature 2020-09-17 21:28:57 +02:00
Trevor Spiteri 9e8d74d1ad add Unwrapped wrapper 2020-09-17 20:22:53 +02:00
Trevor Spiteri c7c57b09f0 fix doc links 2020-09-17 20:03:55 +02:00
Trevor Spiteri c1119a0d12 add unwrapped from_num and to_num methods 2020-09-17 19:13:32 +02:00
Trevor Spiteri 8756a4bd5c add unwrapped arithmetic methods 2020-09-17 18:40:32 +02:00
Trevor Spiteri ff9211e9ab add unwrapped rounding methods 2020-09-17 18:03:05 +02:00
Trevor Spiteri 7a03bd6364 add unwrapped experimental feature 2020-09-17 16:58:26 +02:00
Trevor Spiteri 1b5a5b39ae version 1.2.0 2020-09-02 13:50:04 +02:00
Trevor Spiteri 5e8c87c43a stronger typing inside const_fixed_from_int macro 2020-09-02 13:49:29 +02:00
Trevor Spiteri 22d1551b97 fix a couple of const_fixed_from_int compile_fail tests 2020-09-02 13:25:24 +02:00
Trevor Spiteri d112d55e21 Revert "require rustc 1.46"
This reverts commit 5a4d1a6732.
2020-09-02 13:03:23 +02:00
Trevor Spiteri 0771d5b218 Revert "remove if_cond_else const hack"
This reverts commit 7522557e1d.
2020-09-02 13:03:16 +02:00
Trevor Spiteri be0fd36bf5 const_fixed_from_int implementation that works on rustc 1.44 2020-09-02 12:58:28 +02:00
Trevor Spiteri 78cff5601b const_fixed_from_int tweaks 2020-09-02 12:22:01 +02:00
Trevor Spiteri 7522557e1d remove if_cond_else const hack 2020-09-02 10:22:44 +02:00
Trevor Spiteri 5a4d1a6732 require rustc 1.46 2020-09-02 10:14:04 +02:00
Trevor Spiteri c5fe7e6764 fix corner cases of const_fixed_from_int 2020-09-02 10:10:29 +02:00
Trevor Spiteri 67f697ece5 add const_fixed_from_int compile_fail tests 2020-09-02 09:59:35 +02:00
Trevor Spiteri f95c76651a add const_fixed_from_int! macro 2020-08-28 18:27:23 +02:00
Trevor Spiteri 5b911fc62c version 1.1.0 2020-07-21 08:42:56 +02:00
Trevor Spiteri b60e8ad9ab add num-trait traits to FixedOptionalFeatures 2020-07-16 11:07:25 +02:00
Trevor Spiteri 3dae86ec18 implement num_traits checked ops 2020-07-14 09:11:58 +02:00
Trevor Spiteri 670f04441b implement num_traits::{Bounded,Zero,One} 2020-07-13 15:19:21 +02:00
Trevor Spiteri edbec7062a add experimental feature num-traits 2020-07-13 15:19:15 +02:00
Trevor Spiteri fcdd018240 version 1.0.0 2020-06-04 18:59:55 +02:00
Trevor Spiteri ef36b4f767 make {from,to}_{be,le,ne}_bytes const functions 2020-06-04 18:18:01 +02:00
Trevor Spiteri cd8ee00eac Merge branch 'v0.5' 2020-05-11 20:20:02 +02:00
Trevor Spiteri 2bfc804c4d version 0.5.7 2020-05-11 20:13:11 +02:00
Trevor Spiteri 15ce6efad5 add comment to signed round_to_zero about not being truncation 2020-05-11 19:58:09 +02:00
Trevor Spiteri 13010d6ed9 docs: change wording from truncate to discard fractional bits
Truncation might be interpreted to mean rounding towards zero, which
is not what happens in negative two's-complement fixed-point numbers.
So "extra fractional bits are truncated" is better as "extra
fractional bits are discarded, which rounds towards −∞."
2020-05-11 19:58:05 +02:00
Trevor Spiteri 1eca782f60 add wrapping_next_power_of_two 2020-05-11 19:57:42 +02:00
Trevor Spiteri 8227ae5dd7 add leading_ones and trailing_ones 2020-05-11 19:55:35 +02:00
Trevor Spiteri 41d57b242f fmt nit in doc example 2020-05-11 19:53:25 +02:00
Trevor Spiteri 7b9097191f add some tests 2020-05-11 19:53:22 +02:00
Trevor Spiteri b6219e3b39 implement LosslessTryFrom for lossless integer <-> float combinations 2020-05-11 19:53:20 +02:00
Trevor Spiteri 7db5683fe5 implement LosslessTryFrom for lossless fixed <-> float combinations 2020-05-11 19:53:15 +02:00
Trevor Spiteri be53ccdc32 implement LosslessTryFrom for all fixed<U0> -> integer combinations 2020-05-11 19:53:12 +02:00
Trevor Spiteri a0ddcbee2d implement LosslessTryFrom for all integer -> fixed combinations 2020-05-11 19:53:09 +02:00
Trevor Spiteri 694ae24d77 add LosslessTry{From,Into} and immplement them for Fixed <-> Fixed 2020-05-11 19:52:59 +02:00
Trevor Spiteri c762dadfbc improve first line of module docs 2020-05-11 19:49:46 +02:00
Trevor Spiteri 5cb690a076 fix typos in tests and release notes 2020-05-11 19:49:12 +02:00
Trevor Spiteri 5eb8cdf5c3 add names to some constants 2020-05-11 19:43:17 +02:00
Trevor Spiteri b22a08b66f add golden ratio and its conjugate to constants 2020-05-11 19:42:47 +02:00
Trevor Spiteri 1167020994 document impl blocks 2020-05-11 19:39:50 +02:00
Trevor Spiteri 1b95649362 tweak wording on version 2 plan 2020-05-11 19:39:37 +02:00
Trevor Spiteri 98f7c089dc remove reimplementation of wrapping_signum in Wrapping::signum 2020-05-11 19:39:22 +02:00
Trevor Spiteri 0cd12464cf add comment to signed round_to_zero about not being truncation 2020-05-10 19:09:15 +02:00
Trevor Spiteri 5b7d05b775 docs: change wording from truncate to discard fractional bits
Truncation might be interpreted to mean rounding towards zero, which
is not what happens in negative two's-complement fixed-point numbers.
So "extra fractional bits are truncated" is better as "extra
fractional bits are discarded, which rounds towards −∞."
2020-05-10 18:43:22 +02:00
Trevor Spiteri 961d36aa2a update half dependency to 1.6 2020-05-10 10:49:09 +02:00
Trevor Spiteri c13ab2e324 add wrapping_next_power_of_two 2020-05-10 01:13:24 +02:00
Trevor Spiteri dfb59cefc0 add leading_ones and trailing_ones 2020-05-10 01:09:41 +02:00
Trevor Spiteri 609f75575f fmt nit in doc example 2020-05-08 15:55:49 +02:00
Trevor Spiteri 2b4e051ded add some tests 2020-05-08 15:43:01 +02:00
Trevor Spiteri e3fe9b7f9c implement LosslessTryFrom for lossless integer <-> float combinations 2020-05-08 15:19:09 +02:00
Trevor Spiteri c2847491cb implement LosslessTryFrom for lossless fixed <-> float combinations 2020-05-08 14:23:23 +02:00
Trevor Spiteri c196899bcc implement LosslessTryFrom for all fixed<U0> -> integer combinations 2020-05-08 13:31:50 +02:00
Trevor Spiteri 234dbfecdc implement LosslessTryFrom for all integer -> fixed combinations 2020-05-08 13:20:47 +02:00
Trevor Spiteri bc5e01120f add LosslessTry{From,Into} and immplement them for Fixed <-> Fixed 2020-05-08 12:41:35 +02:00
Trevor Spiteri f23ddc6616 improve first line of module docs 2020-05-08 00:51:56 +02:00
Trevor Spiteri eebb76e7b0 fix typos in tests and release notes 2020-05-08 00:37:14 +02:00
Trevor Spiteri 232decb692 add names to some constants 2020-05-07 23:48:48 +02:00
Trevor Spiteri 37167fddd0 add golden ratio and its conjugate to constants 2020-05-07 23:36:35 +02:00
Trevor Spiteri eb7e369775 document impl blocks 2020-05-03 17:56:04 +02:00
Trevor Spiteri ff0874a1f4 require rustc 1.43.0
Will probably bump requirement to 1.44.0 before releasing 1.0.0 so
that {from,to}_{le,be,ne}_bytes can be const fn.
2020-05-03 16:08:11 +02:00
Trevor Spiteri 48a763c01f tweak wording on version 2 plan 2020-05-02 21:22:46 +02:00
Trevor Spiteri eb51b85db5 remove reimplementation of wrapping_signum in Wrapping::signum 2020-05-02 21:19:44 +02:00
Trevor Spiteri 879861b875 remove deprecated items 2020-05-01 18:28:17 +02:00
Trevor Spiteri 079a13ca1b version 0.5.6 2020-05-01 18:15:40 +02:00
Trevor Spiteri 86b542e7f3 add Lossy{From,Into} to prelude 2020-05-01 17:40:53 +02:00
Trevor Spiteri 672973c99f Revert "remove deprecated items"
This reverts commit f67aed0078.
2020-04-18 19:13:08 +02:00
Trevor Spiteri 74f0e4f575 add checked versions of signum 2020-04-18 18:15:22 +02:00
Trevor Spiteri 339bd1f5aa specify version 2 when talking about const generics plan 2020-04-18 02:29:04 +02:00
Trevor Spiteri f67aed0078 remove deprecated items 2020-04-18 02:21:17 +02:00
Trevor Spiteri f8f9bd69ba add some coverage 2020-04-17 22:11:57 +02:00
Trevor Spiteri 8d8fde75c5 remove unused functions 2020-04-17 21:48:25 +02:00
Trevor Spiteri a47367fa6b make reasoning clearer in log10 2020-04-17 21:31:13 +02:00
Trevor Spiteri ed49d69e18 test constant LOG2_10 and LOG10_2 with f16 and bf16 2020-04-17 17:21:37 +02:00
Trevor Spiteri 800ed3a58c az::StaticCast is deprecated 2020-04-17 17:20:25 +02:00
Trevor Spiteri 9bb95c5a5c remove unused macro parameter 2020-04-17 00:01:00 +02:00
Trevor Spiteri 97d4e1a326 version 0.5.5 2020-04-16 23:29:50 +02:00
Trevor Spiteri 289f4b1697 add constants in consts module as associated constants 2020-04-16 23:08:29 +02:00
Trevor Spiteri 68c0fa6f8d include generator in consts.rs 2020-04-16 23:05:53 +02:00
Trevor Spiteri 5db3b17284 fix comparison of e.g. I0F16 with +0.5 2020-04-16 21:19:30 +02:00
Trevor Spiteri 4c25f002a1 update copyright date 2020-04-13 20:11:39 +02:00
Trevor Spiteri 36ef9cae03 use macro to avoid repetitions in log10 tests 2020-04-13 18:12:56 +02:00
Trevor Spiteri f038d17921 some log10 cleanups 2020-04-13 05:23:29 +02:00
Trevor Spiteri de69767a3c fmt 2020-04-13 04:28:23 +02:00
Trevor Spiteri b0f6deab9e some log10 optimizations 2020-04-13 04:27:36 +02:00
Trevor Spiteri a32b56ab43 add int_log10 and checked_int_log10 2020-04-13 03:17:21 +02:00
Trevor Spiteri 919519fea1 doc nits 2020-04-13 00:27:42 +02:00
Trevor Spiteri e8f3ff2c67 replace {min,max}_value() by {MIN,MAX} in examples
There are hidden import lines

    use std::primitive;

that should be removed once MIN and MAX are supported by the minimum
supported rustc.
2020-04-11 19:23:58 +02:00
Trevor Spiteri 47287ab98f replace {int,frac}_nbits() by {INT,FRAC}_NBITS 2020-04-11 18:50:26 +02:00
Trevor Spiteri e1febebb31 replace {min,max}_value() by {MIN,MAX} 2020-04-11 18:34:52 +02:00
Trevor Spiteri 91bd73bca4 add int_log2 and checked_int_log2 2020-04-11 17:44:09 +02:00
Trevor Spiteri 060b58af13 doc: use [`true`] instead of [`true`][`bool`]
This is because link markdown is not interpreted in search results, so
at least bool is not displayed.
2020-04-11 16:54:22 +02:00
Trevor Spiteri b41c726da5 test constant LOG2_10 and LOG10_2
Before this commit, the tests were skipped because the corresponding
standard library constants were unstable, but the values themselves
could easily be computed for the test. Once the minimum rustc
supported becomes 1.43.0, the tests should be changed to use the
constants instead of the computation.
2020-04-08 13:23:04 +02:00
Trevor Spiteri b035ae9dbe typo 2020-04-08 12:51:11 +02:00