Implement full SSD1306 OLED display support: - Splash screen on boot (1.5s) with project name, version, board - Dashboard showing radio state, config, counters, RSSI/SNR - RSSI history sparkline (64-sample ring buffer, 2px-wide bars) - DisplayOn/DisplayOff host commands routed via dedicated channel - Pure render functions against generic DrawTarget (no hardware coupling) - Display on/off control bypasses radio task entirely Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
92 KiB
92 KiB
Version 1.29.0 (2025-02-26)
- The crate now requires rustc version 1.83.0 or later.
- The following methods were added to all fixed-point numbers, to the
Fixedtrait, and to theSaturating,WrappingandUnwrappedwrappers:unbounded_shl,unbounded_shrfrom_ascii,from_ascii_binary,from_ascii_octal,from_ascii_hexsaturating_from_ascii,saturating_from_ascii_binary,saturating_from_ascii_octal,saturating_from_ascii_hexwrapping_from_ascii,wrapping_from_ascii_binary,wrapping_from_ascii_octal,wrapping_from_ascii_hexunwrapped_from_ascii,unwrapped_from_ascii_binary,unwrapped_from_ascii_octal,unwrapped_from_ascii_hexoverflowing_from_ascii,overflowing_from_ascii_binary,overflowing_from_ascii_octal,overflowing_from_ascii_hex
- The
cast_unsignedmethod was added to all signed fixed-point numbers, to theirSaturating,WrappingandUnwrappedwrappers, and to theFixedtrait. - The
cast_signedmethod was added to all unsigned fixed-point numbers, to theirSaturating,WrappingandUnwrappedwrappers, and to theFixedtrait. - The following methods are now usable in constant context:
- Now
ParseFixedErrorimplementsErroreven when thestdoptional feature is disabled.
Version 1.28.0 news (2024-07-25)
- The crate now requires rustc version 1.79.0 or later.
- The following methods were added to all fixed-point numbers and to the
Fixedtrait: - For all fixed-point numbers and the
Fixedtrait, the following methods were renamed. The old method names are deprecated.round_ties_to_evenrenamed toround_ties_evenchecked_round_ties_to_evenrenamed tochecked_round_ties_evensaturating_round_ties_to_evenrenamed tosaturating_round_ties_evenwrapping_round_ties_to_evenrenamed towrapping_round_ties_evenunwrapped_round_ties_to_evenrenamed tounwrapped_round_ties_evenoverflowing_round_ties_to_evenrenamed tooverflowing_round_ties_even
- The following constants were added to the
constsmodule and as associated constants to fixed-point types: - The experimental feature
nightly-floatwas added. - For the experimental feature
num-traits, the following traits were implemented for all fixed-point numbers:
Version 1.27.0 (2024-03-27)
- The
hypotmethod was added to all fixed-point numbers, to theFixedtrait, and to theSaturating,WrappingandUnwrappedwrappers. - The following methods were added to all fixed-point numbers and to the
Fixedtrait:
Version 1.26.0 (2024-03-06)
- The
sqrtmethod was added to all fixed-point numbers, to theFixedtrait, and to theSaturating,WrappingandUnwrappedwrappers. - The
checked_sqrtmethod was added to all fixed-point numbers and to theFixedtrait.
Version 1.25.1 (2024-02-06)
- Bug fix: formatting numbers with
LowerExpandUpperExpwas producing incorrect output when rounding incremented a zero in the middle of a string, for exampleformat!("{:.2e}", I16F16::lit("9.099")).
Version 1.25.0 (2024-02-05)
- Bug fix: formatting numbers with
LowerExpandUpperExpwas producing incorrect output for very small numbers, for exampleformat!("{:e}", I16F16::DELTA). - Bug fix: formatting numbers with
LowerExpandUpperExpwas panicking for some cases of positive exponents and small precision, for exampleformat!("{:.1e}", I16F16::from_num(1001)). - Bug fix: formatting numbers with
LowerExpandUpperExpwas producing incorrect output when rounding adds a more significant digit, for exampleformat!("{:.1e}", I16F16::lit("0.999")). - The experimental
borshfeature was promoted to an optional feature, and the optional borsh crate dependency was updated to version 1.0.
Version 1.24.0 (2023-09-19)
- The crate now requires rustc version 1.71.0 or later.
- The
saturating_div_intmethod was added to all fixed-point numbers and to theFixedtrait. - The
Saturatingwrapper was added.
Version 1.23.1 (2023-03-14)
- Bug fix: comparison of signed and unsigned numbers where the signed number was wider than the unsigned number was truncating bits from the signed number (issue 57).
- The half crate dependency is now satisfied by version 1.8 as well as version 2.
Version 1.23.0 (2023-02-06)
- String parsing of binary, octal and hexadecimal strings now supports base-2
exponents starting with the separator “
p” or “P”. - Bug fix:
int_log10,int_log,checked_int_log10andchecked_int_logwere panicking or returning incorrect values for fixed-point numbers with no integer bits.
Version 1.22.1 (2023-01-26)
- The errors from the
litmethod have been improved. - The
track_callerattribute is now applied to many more inline functions that can panic.
Version 1.22.0 (2023-01-25)
- String parsing now supports an optional exponent for all supported radices.
- The
litmethod was added to all fixed-point numbers. This is useful to write fixed-point numbers literally in code and also works in constant context. - All fixed-point numbers now implement
LowerExpandUpperExp. - The
FixedandFixedBitstraits now have the added supertraitsBinary,Octal,LowerHex,UpperHex,LowerExpandUpperExp. - The
WrappingandUnwrappedwrappers now implementBinary,Octal,LowerHex,UpperHex,LowerExpandUpperExp. - The implementation of
Debugfor fixed-point numbers now has more relaxed constraints on the fractional bits generic parameter: nowFraconly needs to implementUnsigned.
Version 1.21.0 (2022-12-24)
- Comparisons involving fixed-point numbers now have more relaxed constraints
on the fractional bits generic parameter: now
Fraconly needs to implementUnsigned. - Better code should now be generated when comparing a fixed-point number to another fixed-point number.
- The following methods were added to the
F128struct:
Version 1.20.0 (2022-11-08)
- The
TRY_ONEassociated constant was added to theFixedtrait. - The
TRY_NEG_ONEassociated constant was added to theFixedSignedtrait. - The
const_from_fixedandconst_from_intmethods were added to all fixed-point numbers. - The
const_fixed_from_intmacro is now deprecated. - The following associated constants were added to the
F128struct: F128now implementsFromfor conversions fromf64,f32,f16andbf16.- The
fixed::f128::constsmodule was added withF128basic mathematical constants.
Version 1.19.0 (2022-08-29)
- Bug fix: comparison of and conversion from subnormal floating-point numbers to fixed-point numbers were off by a factor of 2.
- The following associated constants were added to the
FixedBitstrait: FixedEquivis now a supertrait of theFixedBitstrait.FixedBitsnow has more supertraits from the num-traits crate if thenum-traitsexperimental feature is enabled.
Version 1.18.0 (2022-08-19)
- Bug fix: checked division methods were panicking when dividing
MINby-DELTAfor fixed-point numbers with zero integer bits, that is when all bits are fractional bits (issue 51). - The following methods were added to all fixed-point numbers, to the
Fixedtrait, and to theWrappingandUnwrappedwrappers: - The
F128struct was added to replace theF128Bitsstruct which is now deprecated.F128has standard floating-point ordering and various classification methods and associated constants. - The
from_str_decmethod was added to theUnwrappedwrapper. - The
Contiguoustrait from the bytemuck crate was implemented for all fixed-point numbers, added as a supertrait to theFixedtrait, and implemented for theWrappingandUnwrappedwrappers.
Version 1.17.0 (2022-08-03)
- The half crate dependency was updated to version 2.
- The inherent
from_strmethod was added as aconstfunction to all fixed-point numbers so that it can be use in constant context. - The following methods are now
constfunctions:saturating_from_str,wrapping_from_str,overflowing_from_strfrom_str_binary,saturating_from_str_binary,wrapping_from_str_binary,overflowing_from_str_binaryfrom_str_octal,saturating_from_str_octal,wrapping_from_str_octal,overflowing_from_str_octalfrom_str_hex,saturating_from_str_hex,wrapping_from_str_hex,overflowing_from_str_hexchecked_div,saturating_div,wrapping_div,unwrapped_div,overflowing_divrecip,checked_recip,saturating_recip,wrapping_recip,unwrapped_recip,overflowing_recipchecked_rem_int,unwrapped_rem_intdiv_euclid,checked_div_euclid,saturating_div_euclid,wrapping_div_euclid,unwrapped_div_euclid,overflowing_div_eucliddiv_euclid_int,checked_div_euclid_int,saturating_div_euclid_int,wrapping_div_euclid_int,unwrapped_div_euclid_int,overflowing_div_euclid_intrem_euclid_int,checked_rem_euclid_int,saturating_rem_euclid_int,wrapping_rem_euclid_int,unwrapped_rem_euclid_int,overflowing_rem_euclid_intlerp,checked_lerp,saturating_lerp,wrapping_lerp,unwrapped_lerp,overflowing_lerpinv_lerp,checked_inv_lerp,saturating_inv_lerp,wrapping_inv_lerp,unwrapped_inv_lerp,overflowing_inv_lerp
- The following methods were added to all fixed-point numbers and to the
Fixedtrait: - Bug fix: The following methods were not panicking on all errors as required for
the
Unwrappedwrapper:<Unwrapped<F> as FromStr>::from_strUnwrapped<F>::from_str_binaryUnwrapped<F>::from_str_octalUnwrapped<F>::from_str_hex
Version 1.16.1 (2022-07-22)
- Cargo.toml now includes the
rust-versionfield (merge request 11).
Version 1.16.0 (2022-06-30)
- The crate now requires rustc version 1.61.0 or later.
- The
NEG_ONEconstant was added to all signed fixed-point numbers that can represent the value −1. - The
add_prodmethod was added to all fixed-point numbers, to theFixedtrait, and to theWrappingandUnwrappedwrappers. - The following methods were added to all fixed-point numbers and to the
Fixedtrait: - The following methods are now
constfunctions:int,frac,round_to_zeroceil,checked_ceil,saturating_ceil,wrapping_ceil,unwrapped_ceil,overflowing_ceilfloor,checked_floor,saturating_floor,wrapping_floor,unwrapped_floor,overflowing_floorround,checked_round,saturating_round,wrapping_round,unwrapped_round,overflowing_roundround_ties_to_even,checked_round_ties_to_even,saturating_round_ties_to_even,wrapping_round_ties_to_even,unwrapped_round_ties_to_even,overflowing_round_ties_to_evenint_log2,checked_int_log2,int_log10,checked_int_log2wide_mul,wide_mul_unsigned,wide_mul_signedwide_div,wide_sdiv,wide_div_unsigned,wide_sdiv_signedchecked_mul,saturating_mul,wrapping_mul,unwrapped_mul,overflowing_mulmul_add,checked_mul_add,saturating_mul_add,wrapping_mul_add,unwrapped_mul_add,overflowing_mul_addsignum,checked_signum,saturating_signum,wrapping_signum,unwrapped_signum,overflowing_signum
Version 1.15.0 (2022-04-28)
- The following methods were added to all fixed-point signed numbers up to 64 bits wide:
- The following methods were added to all fixed-point unsigned numbers up to 64 bits wide:
Version 1.14.0 (2022-03-20)
- The
next_multiple_ofmethod was added to all fixed-point numbers, to theFixedtrait, and to theWrappingandUnwrappedwrappers. - The following methods were added to all fixed-point numbers and to the
Fixedtrait: - The following methods were added to all signed fixed-point numbers, to the
FixedSignedtrait, and to theWrappingandUnwrappedwrappers for signed numbers: - The following methods were added to all unsigned fixed-point numbers, to the
FixedUnsignedtrait, and to theWrappingandUnwrappedwrappers for unsigned numbers: - Supertraits were added to
Fixed::Bitsand toFixed::NonZeroBitsin order to allow conversions and operations in generic functions. - The az crate dependency was updated to version 1.2.
Version 1.13.1 (2022-03-04)
- The
const_fixed_from_intmacro now accepts a visibility qualifier (merge request 10).
Version 1.13.0 (2022-02-22)
- The
AddAssign,SubAssign,MulAssign,DivAssign,RemAssign,BitAndAssign,BitOrAssignandBitXorAssigntraits forWrapping<F>andUnwrapped<F>are now also implemented withFas the type of the right-hand side operand. - Bug fix: compilation with certain flags was hanging for the thumbv6m target because of a rustc/LLVM issue. This version should not trigger the rustc/LLVM issue (issue 45).
Version 1.12.0 (2022-02-04)
- The crate now requires rustc version 1.57.0 or later.
- The
wide_divmethod was added to all fixed-point numbers up to 64 bits wide (issue 25). - The following methods are now
constfunctions:
Version 1.11.0 (2021-11-24)
- The following methods were added to all fixed-point numbers, to the
Fixedtrait, and to theWrappingandUnwrappedwrappers: - The following methods were added to all fixed-point numbers and to the
Fixedtrait: - The typenum crate dependency was updated to version 1.14.
- The
LeEqU8,LeEqU16,LeEqU32,LeEqU64andLeEqU128traits no longer have a direct'staticconstraint, as it is a constraint of their supertraitUnsignedsince typenum version 1.14. This fixes a potential compatibility issue introduced in version 1.9.0. - An experimental feature was added to enable serialization using the borsh crate (merge request 9).
Version 1.10.0 (2021-08-23)
- The crate now requires rustc version 1.53.0 or later.
{Div,DivAssign,Rem,RemAssign}<NonZeroU32>are now implemented forFixedU32, and similar for all other unsigned fixed-point numbers.{Rem,RemAssign}<NonZeroI32>are now implemented forFixedI32, and similar for all other signed fixed-point numbers.- The new
arbitraryoptional feature was added to implement theArbitrarytrait provided by the arbitrary crate for all fixed-point numbers (issue 37).
Version 1.9.0 (2021-05-13)
- Fixed-point numbers can now be formatted as hexadecimal with
Debugsimilarly to primitive integers, for example formatting with{:X?}will produce upper-case hexadecimal fixed-point numbers. - The following methods were added to all fixed-point numbers, to the
Fixedtrait, and to theWrappingandUnwrappedwrappers: - The following methods were added to all fixed-point numbers and to the
Fixedtrait: - The
unsigned_distmethod was added to all signed fixed-point types and to theFixedSignedtrait. - The following associated types and provided methods were added to the
Fixedtrait: - The new trait
FixedEquivwas added. - The following traits from the bytemuck crate were implemented for all
fixed-point numbers, added as supertraits to the
Fixedtrait, and implemented for theWrappingandUnwrappedwrappers (issue 31).
Compatibility notes
- Now the
Debugimplementation forWrappingoutputs the value only without “Wrapping()”, and theDebugimplementation forUnwrappedoutputs the value only without “Unwrapped()”. - The
LeEqU8,LeEqU16,LeEqU32,LeEqU64andLeEqU128traits now have a'staticconstraint. This should have no practical side effects, since these traits are a convenience feature and already have theUnsignedmarker trait as a supertrait, and the types that implementUnsignedare'static. - The
FixedOptionalFeaturestrait was not sealed, which was as an oversight. Now it is sealed, and the documentation explicitly states that the trait should not be used directly.
Version 1.8.0 (2021-04-20)
- The following constants and method were added to all fixed-point numbers, to
the
Fixedtrait, and to theWrappingandUnwrappedwrappers: - The
ONEconstant was added to all fixed-point numbers that can represent the value 1. - The following methods were added to all fixed-point numbers and to the
Fixedtrait: - The following methods are now
constfunctions: - The following methods were added to all fixed-point numbers:
- Many methods were marked with the
must_useattribute.
Version 1.7.0 (2021-03-25)
- The crate now requires rustc version 1.50.0 or later.
- The following methods are now
constfunctions: - The following constant and methods were added to all fixed-point numbers, to
the
Fixedtrait, and to theWrappingandUnwrappedwrappers: - The following methods were added to the
WrappingandUnwrappedwrappers: - The following methods were added to all unsigned fixed-point types, to the
FixedUnsignedtrait, and to theWrappingandUnwrappedwrappers for unsigned numbers: - The
signed_bitsmethod was added to all signed fixed-point types, to theFixedSignedtrait, and to theWrappingandUnwrappedwrappers for signed numbers. - The following constants, which are available in other programming language
standard libraries, were added to the
constsmodule and as associated constants to fixed-point types:SQRT_PI(Go),FRAC_1_SQRT_PI(C++)SQRT_3(C++),FRAC_1_SQRT_3(C++)SQRT_E(Go)SQRT_PHI(Go)GAMMA(C++)CATALAN(Julia)
SumandProductare now supertraits of theFixedtrait.- The
F128Bitstype was added to support conversions and comparisons between fixed-point numbers and binary128 floating-point numbers. - The features that previously required the
azandf16optional features are now always provided. Theazandf16optional features are now deprecated and have no effect. - For the experimental feature
num-traits, the following traits were implemented for all fixed-point numbers:
Version 1.6.0 (2021-02-05)
- The crate now requires rustc version 1.47.0 or later.
- The optional az crate dependency was updated to version 1.1.
- The
unsigned_absmethod was added to all signed fixed-point types and to theFixedSignedtrait. - The following methods are now
constfunctions: - The
unwrapped_to_fixedmethod was added to theToFixedtrait. - The
unwrapped_from_fixedmethod was added to theFromFixedtrait.
Version 1.5.0 (2020-11-05)
- The
wide_mulmethod was added to all fixed-point numbers up to 64 bits wide (issue 25). - Unwrapped methods for arithmetic together with the
Unwrappedwrapper were added. Unwrapped methods panic on overflow, even when debug assertions are disabled, similar to how wrapping methods will wrap around even when debug assertions are enabled. (This was previously an experimental featureunwrapped.) - The
serde-strfeature was added. (This was previously an experimental feature.) - For the experimental feature
num-traits, some missing supertraits were added toFixedOptionalFeatures. - Bug fix: multiplication of
FixedI128was panicking when multiplying some large negative numbers (issue 26).
Version 1.4.0 (2020-10-22)
- The following methods were added to all fixed-point types, to the
Fixedtrait, and to theWrappingwrapper: - For the experimental feature
num-traits, the following traits were implemented where applicable (issue 23): - For the experimental feature
serde-str, serialization in human-readable formats was made more convenient to write manually (issue 24). This makes it incompatible with the version in 1.3.0.
Version 1.3.0 (2020-10-15)
- The
MulAssignimplementation on fixed-point numbers now accepts an rhs fixed-point number with a different number of fractional bits fromself. - The following methods were added to all fixed-point types, to the
Fixedtrait, and to theWrappingwrapper: - The new experimental feature
unwrappedwas added, providing arithmetic methods that panic on overflow even when debug assertions are disabled. - The new experimental feature
serde-strwas added, which makes serialization use the number’s value in human-readable formats.
Version 1.2.0 (2020-09-02)
- The
const_fixed_from_int!macro was added to make it easy to define constant fixed-point numbers using integer expressions (issue 20).
Version 1.1.0 (2020-07-21)
- The new experimental feature
num-traitswas added to implement some traits, and to also add the relevant traits as supertraits to theFixedOptionalFeaturestrait (issue 18).
Version 1.0.0 (2020-06-04)
- The crate now requires rustc version 1.44.0 or later.
- The following methods are now
constfunctions: - All deprecated items were removed.
Version 0.5.7 (2020-05-11)
- The
LosslessTryFromandLosslessTryIntotraits were added. - The following methods were added to all fixed-point types, to the
Fixedtrait, and to theWrappingwrapper:leading_ones,trailing_ones
- The following method was added to unsigned fixed-point types and to the
FixedUnsignedtrait:wrapping_next_power_of_two
- The
PHIandFRAC_1_PHIconstants were added to theconstsmodule and as associated constants to fixed-point types.
Version 0.5.6 (2020-05-01)
- The following methods were added to signed fixed-point types and to the
FixedSignedtrait:checked_signum,saturating_signum,wrapping_signum,overflowing_signum
- The
LossyFromandLossyIntotraits were added to the prelude. - Casts deprecated in version 0.3.1 of the az crate were marked as deprecated.
Version 0.5.5 (2020-04-16)
- Bug fix: an incorrect result could be given when comparing a signed
fixed-point number of type
FixedIto a number that would overflow by exactly one bit when converting toFixedI. - The following associated constants were added to all fixed-point types, to
the
Fixedtrait, and to theWrappingwrapper:MIN,MAX
- The following associated constants were added to the
Fixedtrait and to theWrappingwrapper:INT_NBITS,FRAC_NBITS
- The following methods were added to all fixed-point types and to the
Fixedtrait:int_log2,int_log10checked_int_log2,checked_int_log10
- The following methods were added to the
Wrappingwrapper:int_log2,int_log10
- The constants in the
constsmodule were also added as associated constants to fixed-point types that can represent them. - The following methods were deprecated:
min_value,max_valueint_nbits,frac_nbits
Version 0.5.4 (2020-02-21)
- Bug fix:
rem_euclid_intand its checked versions were handling overflow incorrectly.
Version 0.5.3 (2020-02-13)
- Bug fix:
round_to_zerowas returning incorrect results for negative whole number operands. - Bug fix: all remainder operations with a fixed-point LHS and an integer RHS were giving an incorrect answer (https://gitlab.com/tspiteri/fixed/issues/13).
- Bug fix: Euclidean division operations by integers were giving an incorrect answer.
RemandRemAssignwere implemented for fixed-point numbers.- The following methods were added to all fixed-point types and to the
Fixedtrait:checked_remdiv_euclid,rem_euclidchecked_div_euclid,checked_rem_euclidsaturating_div_euclidwrapping_div_euclidoverflowing_div_euclid
- The following methods were added to the
Wrappingwrapper:div_euclid,rem_eucliddiv_euclid_int,rem_euclid_int
- The following methods were deprecated:
wrapping_rem_int,overflowing_rem_int
Version 0.5.2 (2020-02-02)
Wrappingnow supports serialization. (Thanks: Shane Pearman)
Version 0.5.1 (2019-12-22)
ParseFixedErrorimplementsErrorwhen the newstdfeature is enabled.
Version 0.5.0 (2019-12-06)
- The crate now requires rustc version 1.39.0 or later.
- The following methods were added to all fixed-point types and to the
Fixedtrait:from_be_bytes,from_le_bytes,from_ne_bytesto_be_bytes,to_le_bytes,to_ne_bytesdiv_euclid_int,rem_euclid_intchecked_div_euclid_int,checked_rem_euclid_intwrapping_div_euclid_int,wrapping_rem_euclid_intoverflowing_div_euclid_int,overflowing_rem_euclid_int
- Casts deprecated in version 0.3.1 of the az crate were marked as deprecated.
Incompatible changes
- Deprecated methods and modules were removed.
Version 0.4.6 (2019-10-16)
- Conversions to/from
bf16are now provided when thef16option is enabled. - The following methods are now
constfunctions:saturating_neg,saturating_add,saturating_sub,saturating_mul_int,saturating_abs - Support for casts using the az crate was added.
Version 0.4.5 (2019-08-30)
- Bug fix: display of many decimal numbers was panicking in debug mode or including a leading zero in release mode.
- Many methods were added to
Wrappingfor convenience, even if they do not involve wrapping.
Version 0.4.4 (2019-08-24)
- Bug fix: rounding could produce bad output for
Binary,Octal,LowerHexandUpperHex. - The following methods are now
constfunctions:is_power_of_two,abs,wrapping_abs,overflowing_abs - The method
round_to_zerowas added. - The method
round_ties_to_evenand its checked versions were added.
Version 0.4.3 (2019-08-20)
- The crate now requires rustc version 1.34.0 or later.
- The precision argument is no longer ignored when formatting fixed-point numbers; precision should now be handled the same as for primitive floating-point numbers in the standard library.
- Parsing strings now rounds to the nearest with ties rounded to even.
- Checked versions of string parsing methods are now available as inherent
methods to all fixed-point numbers, and as methods in the
Fixedtrait. Wrappingnow has methods for parsing with wrapping, including an implementation ofFromStr.- The following methods are now
constfunctions:min_value,max_value,from_bits,to_bitscount_ones,count_zeros,leading_zeros,trailing_zerosrotate_left,rotate_rightwrapping_neg,wrapping_add,wrapping_sub,wrapping_mul_int,wrapping_shl,wrapping_shroverflowing_neg,overflowing_add,overflowing_sub,overflowing_mul_int,overflowing_shl,overflowing_shris_positive,is_negative
- The associated constants
INT_NBITSandFRAC_NBITSwere added. - The reexports in the
fracmodule and theLeEqU*traits were moved into the newtypes::extramodule.
Version 0.4.2 (2019-08-16)
- The new methods
from_numandto_numtogether with their checked versions were added to all fixed-point numbers. - The methods
from_fixed,to_fixed,from_int,to_int,from_float, andto_float, and their checked versions, were deprecated. - The new method
from_numwas added to theWrappingwrapper. - Bug fix: parsing of decimal fractions was fixed to give correctly rounded results for long decimal fraction strings, for example with four fractional bits, 0.96874999… (just below 31⁄32) and 0.96875 (31⁄32) are now parsed correctly as 0.9375 (15⁄16) and 1.0.
Version 0.4.1 (2019-08-12)
- All fixed-point types now implement
FromStr. - The methods
from_str_binary,from_str_octalandfrom_str_hexwere added.
Version 0.4.0 (2019-08-08)
- The crate now requires rustc version 1.31.0 or later.
- The
traitsmodule was added, with its traitsFixed,FixedSigned,FixedUnsigned,FromFixed,ToFixed,LossyFromandLossyInto. - The
saturating_negmethod was added to all fixed-point numbers, and thesaturating_absmethod was added to signed fixed-point numbers. - The
constsmodule was added. - The
signummethod now wraps instead of panics in release mode.
Incompatible changes
- The sealed traits
IntandFloatnow have no provided methods; the methods in the old implementation are now provided byFromFixedandToFixed. - Deprecated methods were removed.
Contributors
- @jean-airoldie
- @tspiteri
Version 0.3.3 (2019-06-27)
- Conversions to/from
isizeandusizewere added.
Version 0.3.2 (2019-02-27)
- The
Wrappingwrapper was added.
Version 0.3.1 (2019-02-07)
- Reimplement
From<bool>for all fixed-point types which can represent the integer 1. This was inadvertently removed in 0.3.0.
Version 0.3.0 (2019-02-03)
- Incompatible change: the return type of
to_intis now generic. - Incompatible change: the
Inttrait implementation forboolwas removed. - The new method
to_fixedwas added. - The new methods
checked_to_fixed,checked_to_int,saturating_to_fixed,saturating_to_int,wrapping_to_fixed,wrapping_to_int,overflowing_to_fixedandoverflowing_to_intwere added. - The methods
from_fixed,to_fixed,checked_from_fixed,checked_to_fixed,saturating_from_fixed,saturating_to_fixed,wrapping_from_fixed,wrapping_to_fixed,overflowing_from_fixedandoverflowing_to_fixedwere added to theInttrait. - The methods
from_fixed,to_fixed,checked_to_fixed,saturating_to_fixed,wrapping_to_fixedandoverflowing_to_fixedwere added to theFloattrait. PartialEqandPartialCmpare now implemented for all combinations of fixed-point numbers and primitive integers.- The methods
int_bitsandfrac_bitswere deprecated and replaced by the methodsint_nbitsandfrac_nbits.
Version 0.2.1 (2019-01-29)
- Bug fix: the
from_fixedandfrom_intmethods (and their checked counterparts) could return wrong values for negative values. - Bug fix: display was using one fractional digit less than required, thus yielding the same output for diffent fixed-point numbers.
Version 0.2.0 (2019-01-29)
- Incompatible change: The method
from_intwas change to accept a generic parameter. - The new methods
from_fixed,checked_from_fixed,saturating_from_fixed,wrapping_from_fixedandoverflowing_from_fixedwere added. - The new methods
checked_from_int,saturating_from_int,wrapping_from_intandoverflowing_from_intwere added. - The new methods
from_float,checked_from_float,saturating_from_float,wrapping_from_floatandoverflowing_from_floatwere added. - The new method
to_floatwas added. - The methods
from_f16,from_f32,from_f64,to_f16,to_f32andto_f64were deprecated. - The
to_intmethod was fixed to truncate fractional bits as documented for negative values. - The new methods
ceil,floor,round,checked_ceil,checked_floor,checked_round,saturating_ceil,saturating_floor,saturating_round,wrapping_ceil,wrapping_floor,wrapping_round,overflowing_ceil,overflowing_floorandoverflowing_roundwere added. - The methods
to_int_ceil,to_int_floorandto_int_roundwere deprecated.
Version 0.1.6 (2019-01-27)
- Optional serde support was added.
Version 0.1.5 (2019-01-26)
- Lossless infallible conversions between fixed-point numbers and numeric
primitives are now supported using
FromandInto. - A new module
typesis available with aliases for all supported fixed-point numbers.
Version 0.1.4 (2018-11-29)
- Division is now implemented for
FixedI128andFixedU128.
Version 0.1.3 (2018-08-23)
- The
f16feature was added, and new methodsfrom_f16andto_f16were added.
Version 0.1.2 (2018-08-15)
- The crate can now be used without the standard library
std. - New methods
from_f32andfrom_f64were added. - New methods
is_positiveandis_negativewere added to signed fixed-point numbers.
Version 0.1.1 (2018-08-11)
- Comparisons are now supported between all fixed-point numbers with the same underlying integer type.
- New static methods
int_bitsandfrac_bitswere added. - New methods
from_int,to_int,to_int_ceil,to_int_floorandto_int_roundwere added. - New methods
intandfracwere added. - Support for multiplication and division by integers was added.
Version 0.1.0 (2018-08-10)
Unsignedconstants provided by the typenum crate are now used for the number of fractional bits.- Many methods and trait implementations available for primitive integers are now also supported by the fixed-point numbers.