add "see also" to Wrapping and Unwrapped methods and constants

This commit is contained in:
Trevor Spiteri 2021-04-20 17:50:19 +02:00
parent 763820676b
commit 116d041e53
2 changed files with 376 additions and 0 deletions

View File

@ -54,6 +54,9 @@ pub struct Unwrapped<F>(pub F);
impl<F: Fixed> Unwrapped<F> { impl<F: Fixed> Unwrapped<F> {
/// Zero. /// Zero.
/// ///
/// See also <code>FixedI32::[ZERO][FixedI32::ZERO]</code> and
/// <code>FixedU32::[ZERO][FixedU32::ZERO]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -64,6 +67,9 @@ impl<F: Fixed> Unwrapped<F> {
/// The difference between any two successive representable numbers, <i>Δ</i>. /// The difference between any two successive representable numbers, <i>Δ</i>.
/// ///
/// See also <code>FixedI32::[DELTA][FixedI32::DELTA]</code> and
/// <code>FixedU32::[DELTA][FixedU32::DELTA]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -74,6 +80,9 @@ impl<F: Fixed> Unwrapped<F> {
/// The smallest value that can be represented. /// The smallest value that can be represented.
/// ///
/// See also <code>FixedI32::[MIN][FixedI32::MIN]</code> and
/// <code>FixedU32::[MIN][FixedU32::MIN]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -84,6 +93,9 @@ impl<F: Fixed> Unwrapped<F> {
/// The largest value that can be represented. /// The largest value that can be represented.
/// ///
/// See also <code>FixedI32::[MAX][FixedI32::MAX]</code> and
/// <code>FixedU32::[MAX][FixedU32::MAX]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -94,6 +106,9 @@ impl<F: Fixed> Unwrapped<F> {
/// [`true`] if the type is signed. /// [`true`] if the type is signed.
/// ///
/// See also <code>FixedI32::[IS\_SIGNED][FixedI32::IS_SIGNED]</code> and
/// <code>FixedU32::[IS\_SIGNED][FixedU32::IS_SIGNED]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -108,6 +123,9 @@ impl<F: Fixed> Unwrapped<F> {
/// The number of integer bits. /// The number of integer bits.
/// ///
/// See also <code>FixedI32::[INT\_NBITS][FixedI32::INT_NBITS]</code> and
/// <code>FixedU32::[INT\_NBITS][FixedU32::INT_NBITS]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -118,6 +136,9 @@ impl<F: Fixed> Unwrapped<F> {
/// The number of fractional bits. /// The number of fractional bits.
/// ///
/// See also <code>FixedI32::[FRAC\_NBITS][FixedI32::FRAC_NBITS]</code> and
/// <code>FixedU32::[FRAC\_NBITS][FixedU32::FRAC_NBITS]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -129,6 +150,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Creates a fixed-point number that has a bitwise representation /// Creates a fixed-point number that has a bitwise representation
/// identical to the given integer. /// identical to the given integer.
/// ///
/// See also <code>FixedI32::[from\_bits][FixedI32::from_bits]</code> and
/// <code>FixedU32::[from\_bits][FixedU32::from_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -143,6 +167,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Creates an integer that has a bitwise representation identical /// Creates an integer that has a bitwise representation identical
/// to the given fixed-point number. /// to the given fixed-point number.
/// ///
/// See also <code>FixedI32::[to\_bits][FixedI32::to_bits]</code> and
/// <code>FixedU32::[to\_bits][FixedU32::to_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -158,6 +185,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Converts a fixed-point number from big endian to the targets /// Converts a fixed-point number from big endian to the targets
/// endianness. /// endianness.
/// ///
/// See also <code>FixedI32::[from\_be][FixedI32::from_be]</code> and
/// <code>FixedU32::[from\_be][FixedU32::from_be]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -177,6 +207,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Converts a fixed-point number from little endian to the /// Converts a fixed-point number from little endian to the
/// targets endianness. /// targets endianness.
/// ///
/// See also <code>FixedI32::[from\_le][FixedI32::from_le]</code> and
/// <code>FixedU32::[from\_le][FixedU32::from_le]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -195,6 +228,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Converts `self` to big endian from the targets endianness. /// Converts `self` to big endian from the targets endianness.
/// ///
/// See also <code>FixedI32::[to\_be][FixedI32::to_be]</code> and
/// <code>FixedU32::[to\_be][FixedU32::to_be]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -213,6 +249,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Converts `self` to little endian from the targets endianness. /// Converts `self` to little endian from the targets endianness.
/// ///
/// See also <code>FixedI32::[to\_le][FixedI32::to_le]</code> and
/// <code>FixedU32::[to\_le][FixedU32::to_le]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -231,6 +270,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Reverses the byte order of the fixed-point number. /// Reverses the byte order of the fixed-point number.
/// ///
/// See also <code>FixedI32::[swap\_bytes][FixedI32::swap_bytes]</code> and
/// <code>FixedU32::[swap\_bytes][FixedU32::swap_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -247,6 +289,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in big endian. /// as a byte array in big endian.
/// ///
/// See also
/// <code>FixedI32::[from\_be\_bytes][FixedI32::from_be_bytes]</code> and
/// <code>FixedU32::[from\_be\_bytes][FixedU32::from_be_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -265,6 +311,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in little endian. /// as a byte array in little endian.
/// ///
/// See also
/// <code>FixedI32::[from\_le\_bytes][FixedI32::from_le_bytes]</code> and
/// <code>FixedU32::[from\_le\_bytes][FixedU32::from_le_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -283,6 +333,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in native endian. /// as a byte array in native endian.
/// ///
/// See also
/// <code>FixedI32::[from\_ne\_bytes][FixedI32::from_ne_bytes]</code> and
/// <code>FixedU32::[from\_ne\_bytes][FixedU32::from_ne_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -305,6 +359,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in big-endian byte order. /// number as a byte array in big-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_be\_bytes][FixedI32::to_be_bytes]</code>
/// and <code>FixedU32::[to\_be\_bytes][FixedU32::to_be_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -322,6 +379,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in little-endian byte order. /// number as a byte array in little-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_le\_bytes][FixedI32::to_le_bytes]</code>
/// and <code>FixedU32::[to\_le\_bytes][FixedU32::to_le_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -339,6 +399,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in native-endian byte order. /// number as a byte array in native-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_ne\_bytes][FixedI32::to_ne_bytes]</code>
/// and <code>FixedU32::[to\_ne\_bytes][FixedU32::to_ne_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -374,6 +437,9 @@ impl<F: Fixed> Unwrapped<F> {
/// implemented, in which case this method returns /// implemented, in which case this method returns
/// <code>[Unwrapped]\([src.unwrapped_to_fixed()][ToFixed::unwrapped_to_fixed])</code>. /// <code>[Unwrapped]\([src.unwrapped_to_fixed()][ToFixed::unwrapped_to_fixed])</code>.
/// ///
/// See also <code>FixedI32::[from\_num][FixedI32::from_num]</code> and
/// <code>FixedU32::[from\_num][FixedU32::from_num]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the value does not fit. /// Panics if the value does not fit.
@ -434,6 +500,9 @@ impl<F: Fixed> Unwrapped<F> {
/// implemented, in which case this method returns /// implemented, in which case this method returns
/// [`Dst::unwrapped_from_fixed(self.0)`][FromFixed::unwrapped_from_fixed]. /// [`Dst::unwrapped_from_fixed(self.0)`][FromFixed::unwrapped_from_fixed].
/// ///
/// See also <code>FixedI32::[to\_num][FixedI32::to_num]</code> and
/// <code>FixedU32::[to\_num][FixedU32::to_num]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -472,6 +541,11 @@ impl<F: Fixed> Unwrapped<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also
/// <code>FixedI32::[from\_str\_binary][FixedI32::from_str_binary]</code>
/// and
/// <code>FixedU32::[from\_str\_binary][FixedU32::from_str_binary]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -488,6 +562,10 @@ impl<F: Fixed> Unwrapped<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also
/// <code>FixedI32::[from\_str\_octal][FixedI32::from_str_octal]</code> and
/// <code>FixedU32::[from\_str\_octal][FixedU32::from_str_octal]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -504,6 +582,9 @@ impl<F: Fixed> Unwrapped<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also <code>FixedI32::[from\_str\_hex][FixedI32::from_str_hex]</code>
/// and <code>FixedU32::[from\_str\_hex][FixedU32::from_str_hex]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -525,6 +606,9 @@ impl<F: Fixed> Unwrapped<F> {
/// <code>[Unwrapped]&lt;[I0F16]&gt;</code>, where the return /// <code>[Unwrapped]&lt;[I0F16]&gt;</code>, where the return
/// value is always zero. /// value is always zero.
/// ///
/// See also <code>FixedI32::[int][FixedI32::int]</code> and
/// <code>FixedU32::[int][FixedU32::int]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -548,6 +632,9 @@ impl<F: Fixed> Unwrapped<F> {
/// <code>[Unwrapped]&lt;[I0F16]&gt;</code>, where the return /// <code>[Unwrapped]&lt;[I0F16]&gt;</code>, where the return
/// value is always equal to `self`. /// value is always equal to `self`.
/// ///
/// See also <code>FixedI32::[frac][FixedI32::frac]</code> and
/// <code>FixedU32::[frac][FixedU32::frac]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -564,6 +651,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Rounds to the next integer towards 0. /// Rounds to the next integer towards 0.
/// ///
/// See also
/// <code>FixedI32::[round\_to\_zero][FixedI32::round_to_zero]</code> and
/// <code>FixedU32::[round\_to\_zero][FixedU32::round_to_zero]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -580,6 +671,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Unwrapped ceil. Rounds to the next integer towards +∞, panicking /// Unwrapped ceil. Rounds to the next integer towards +∞, panicking
/// on overflow. /// on overflow.
/// ///
/// See also <code>FixedI32::[ceil][FixedI32::ceil]</code> and
/// <code>FixedU32::[ceil][FixedU32::ceil]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -610,6 +704,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Overflow can only occur for signed numbers with zero integer /// Overflow can only occur for signed numbers with zero integer
/// bits. /// bits.
/// ///
/// See also <code>FixedI32::[floor][FixedI32::floor]</code> and
/// <code>FixedU32::[floor][FixedU32::floor]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -637,6 +734,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Unwrapped round. Rounds to the next integer to the nearest, /// Unwrapped round. Rounds to the next integer to the nearest,
/// with ties rounded away from zero, and panics on overflow. /// with ties rounded away from zero, and panics on overflow.
/// ///
/// See also <code>FixedI32::[round][FixedI32::round]</code> and
/// <code>FixedU32::[round][FixedU32::round]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -665,6 +765,11 @@ impl<F: Fixed> Unwrapped<F> {
/// Unwrapped round. Rounds to the next integer to the nearest, /// Unwrapped round. Rounds to the next integer to the nearest,
/// with ties rounded to even, and panics on overflow. /// with ties rounded to even, and panics on overflow.
/// ///
/// See also
/// <code>FixedI32::[round\_ties\_to\_even][FixedI32::round_ties_to_even]</code>
/// and
/// <code>FixedU32::[round\_ties\_to\_even][FixedU32::round_ties_to_even]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -694,6 +799,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of ones in the binary representation. /// Returns the number of ones in the binary representation.
/// ///
/// See also <code>FixedI32::[count\_ones][FixedI32::count_ones]</code> and
/// <code>FixedU32::[count\_ones][FixedU32::count_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -708,6 +816,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of zeros in the binary representation. /// Returns the number of zeros in the binary representation.
/// ///
/// See also <code>FixedI32::[count\_zeros][FixedI32::count_zeros]</code>
/// and <code>FixedU32::[count\_zeros][FixedU32::count_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -722,6 +833,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of leading ones in the binary representation. /// Returns the number of leading ones in the binary representation.
/// ///
/// See also <code>FixedI32::[leading\_ones][FixedI32::leading_ones]</code>
/// and <code>FixedU32::[leading\_ones][FixedU32::leading_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -736,6 +850,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of leading zeros in the binary representation. /// Returns the number of leading zeros in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[leading\_zeros][FixedI32::leading_zeros]</code> and
/// <code>FixedU32::[leading\_zeros][FixedU32::leading_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -750,6 +868,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of trailing ones in the binary representation. /// Returns the number of trailing ones in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[trailing\_ones][FixedI32::trailing_ones]</code> and
/// <code>FixedU32::[trailing\_ones][FixedU32::trailing_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -764,6 +886,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the number of trailing zeros in the binary representation. /// Returns the number of trailing zeros in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[trailing\_zeros][FixedI32::trailing_zeros]</code> and
/// <code>FixedU32::[trailing\_zeros][FixedU32::trailing_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -778,6 +904,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Integer base-2 logarithm, rounded down. /// Integer base-2 logarithm, rounded down.
/// ///
/// See also <code>FixedI32::[int\_log2][FixedI32::int_log2]</code> and
/// <code>FixedU32::[int\_log2][FixedU32::int_log2]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the fixed-point number is ≤ 0. /// Panics if the fixed-point number is ≤ 0.
@ -789,6 +918,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Integer base-10 logarithm, rounded down. /// Integer base-10 logarithm, rounded down.
/// ///
/// See also <code>FixedI32::[int\_log10][FixedI32::int_log10]</code> and
/// <code>FixedU32::[int\_log10][FixedU32::int_log10]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the fixed-point number is ≤ 0. /// Panics if the fixed-point number is ≤ 0.
@ -800,6 +932,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Reverses the order of the bits of the fixed-point number. /// Reverses the order of the bits of the fixed-point number.
/// ///
/// See also <code>FixedI32::[reverse\_bits][FixedI32::reverse_bits]</code>
/// and <code>FixedU32::[reverse\_bits][FixedU32::reverse_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -815,6 +950,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Shifts to the left by `n` bits, unwrapped the truncated bits to the right end. /// Shifts to the left by `n` bits, unwrapped the truncated bits to the right end.
/// ///
/// See also <code>FixedI32::[rotate\_left][FixedI32::rotate_left]</code>
/// and <code>FixedU32::[rotate\_left][FixedU32::rotate_left]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -830,6 +968,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Shifts to the right by `n` bits, unwrapped the truncated bits to the left end. /// Shifts to the right by `n` bits, unwrapped the truncated bits to the left end.
/// ///
/// See also <code>FixedI32::[rotate\_right][FixedI32::rotate_right]</code>
/// and <code>FixedU32::[rotate\_right][FixedU32::rotate_right]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -845,6 +986,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the mean of `self` and `other`. /// Returns the mean of `self` and `other`.
/// ///
/// See also <code>FixedI32::[mean][FixedI32::mean]</code> and
/// <code>FixedU32::[mean][FixedU32::mean]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -862,6 +1006,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Returns the reciprocal (inverse), 1/`self`. /// Returns the reciprocal (inverse), 1/`self`.
/// ///
/// See also <code>FixedI32::[recip][FixedI32::recip]</code> and
/// <code>FixedU32::[recip][FixedU32::recip]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if `self` is zero or on overflow. /// Panics if `self` is zero or on overflow.
@ -889,6 +1036,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Multiply and add. Returns `self` × `mul` + `add`. /// Multiply and add. Returns `self` × `mul` + `add`.
/// ///
/// See also <code>FixedI32::[mul\_add][FixedI32::mul_add]</code> and
/// <code>FixedU32::[mul\_add][FixedU32::mul_add]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -923,6 +1073,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Multiply and accumulate. Adds (`a` × `b`) to `self`. /// Multiply and accumulate. Adds (`a` × `b`) to `self`.
/// ///
/// See also <code>FixedI32::[mul\_acc][FixedI32::mul_acc]</code> and
/// <code>FixedU32::[mul\_acc][FixedU32::mul_acc]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -950,6 +1103,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Euclidean division. /// Euclidean division.
/// ///
/// See also <code>FixedI32::[div\_euclid][FixedI32::div_euclid]</code> and
/// <code>FixedU32::[div\_euclid][FixedU32::div_euclid]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero, or if the division results in overflow. /// Panics if the divisor is zero, or if the division results in overflow.
@ -979,6 +1135,9 @@ impl<F: Fixed> Unwrapped<F> {
/// Remainder for Euclidean division. /// Remainder for Euclidean division.
/// ///
/// See also <code>FixedI32::[rem\_euclid][FixedI32::rem_euclid]</code> and
/// <code>FixedU32::[rem\_euclid][FixedU32::rem_euclid]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -1001,6 +1160,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Euclidean division by an integer. /// Euclidean division by an integer.
/// ///
/// See also
/// <code>FixedI32::[div\_euclid\_int][FixedI32::div_euclid_int]</code> and
/// <code>FixedU32::[div\_euclid\_int][FixedU32::div_euclid_int]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero or if the division results in overflow. /// Panics if the divisor is zero or if the division results in overflow.
@ -1029,6 +1192,10 @@ impl<F: Fixed> Unwrapped<F> {
/// Remainder for Euclidean division. /// Remainder for Euclidean division.
/// ///
/// See also
/// <code>FixedI32::[rem\_euclid\_int][FixedI32::rem_euclid_int]</code> and
/// <code>FixedU32::[rem\_euclid\_int][FixedU32::rem_euclid_int]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -1065,6 +1232,8 @@ impl<F: FixedSigned> Unwrapped<F> {
/// negative numbers, and an initial zero for non-negative /// negative numbers, and an initial zero for non-negative
/// numbers. /// numbers.
/// ///
/// See also <code>FixedI32::[signed\_bits][FixedI32::signed_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1084,6 +1253,8 @@ impl<F: FixedSigned> Unwrapped<F> {
/// Returns [`true`] if the number is > 0. /// Returns [`true`] if the number is > 0.
/// ///
/// See also <code>FixedI32::[is\_positive][FixedI32::is_positive]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1099,6 +1270,8 @@ impl<F: FixedSigned> Unwrapped<F> {
/// Returns [`true`] if the number is < 0. /// Returns [`true`] if the number is < 0.
/// ///
/// See also <code>FixedI32::[is\_negative][FixedI32::is_negative]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1118,6 +1291,8 @@ impl<F: FixedSigned> Unwrapped<F> {
/// Overflow can only occur when trying to find the absolute value /// Overflow can only occur when trying to find the absolute value
/// of the minimum value. /// of the minimum value.
/// ///
/// See also <code>FixedI32::[abs][FixedI32::abs]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the result does not fit. /// Panics if the result does not fit.
@ -1143,6 +1318,8 @@ impl<F: FixedSigned> Unwrapped<F> {
/// Returns a number representing the sign of `self`. /// Returns a number representing the sign of `self`.
/// ///
/// See also <code>FixedI32::[signum][FixedI32::signum]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics /// Panics
@ -1176,6 +1353,9 @@ impl<F: FixedSigned> Unwrapped<F> {
impl<F: FixedUnsigned> Unwrapped<F> { impl<F: FixedUnsigned> Unwrapped<F> {
/// Returns the number of bits required to represent the value. /// Returns the number of bits required to represent the value.
/// ///
/// See also
/// <code>FixedU32::[significant\_bits][FixedU32::significant_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1193,6 +1373,9 @@ impl<F: FixedUnsigned> Unwrapped<F> {
/// Returns [`true`] if the fixed-point number is /// Returns [`true`] if the fixed-point number is
/// 2<sup><i>k</i></sup> for some integer <i>k</i>. /// 2<sup><i>k</i></sup> for some integer <i>k</i>.
/// ///
/// See also
/// <code>FixedU32::[is\_power\_of\_two][FixedU32::is_power_of_two]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1212,6 +1395,8 @@ impl<F: FixedUnsigned> Unwrapped<F> {
/// If `self` > 0, the highest one is equal to the largest power /// If `self` > 0, the highest one is equal to the largest power
/// of two that is ≤ `self`. /// of two that is ≤ `self`.
/// ///
/// See also <code>FixedU32::[highest\_one][FixedU32::highest_one]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1230,6 +1415,9 @@ impl<F: FixedUnsigned> Unwrapped<F> {
/// Returns the smallest power of two that is ≥ `self`. /// Returns the smallest power of two that is ≥ `self`.
/// ///
/// See also
/// <code>FixedU32::[next\_power\_of\_two][FixedU32::next_power_of_two]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the next power of two is too large to fit. /// Panics if the next power of two is too large to fit.

View File

@ -51,6 +51,9 @@ pub struct Wrapping<F>(pub F);
impl<F: Fixed> Wrapping<F> { impl<F: Fixed> Wrapping<F> {
/// Zero. /// Zero.
/// ///
/// See also <code>FixedI32::[ZERO][FixedI32::ZERO]</code> and
/// <code>FixedU32::[ZERO][FixedU32::ZERO]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -61,6 +64,9 @@ impl<F: Fixed> Wrapping<F> {
/// The difference between any two successive representable numbers, <i>Δ</i>. /// The difference between any two successive representable numbers, <i>Δ</i>.
/// ///
/// See also <code>FixedI32::[DELTA][FixedI32::DELTA]</code> and
/// <code>FixedU32::[DELTA][FixedU32::DELTA]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -71,6 +77,9 @@ impl<F: Fixed> Wrapping<F> {
/// The smallest value that can be represented. /// The smallest value that can be represented.
/// ///
/// See also <code>FixedI32::[MIN][FixedI32::MIN]</code> and
/// <code>FixedU32::[MIN][FixedU32::MIN]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -81,6 +90,9 @@ impl<F: Fixed> Wrapping<F> {
/// The largest value that can be represented. /// The largest value that can be represented.
/// ///
/// See also <code>FixedI32::[MAX][FixedI32::MAX]</code> and
/// <code>FixedU32::[MAX][FixedU32::MAX]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -91,6 +103,9 @@ impl<F: Fixed> Wrapping<F> {
/// [`true`] if the type is signed. /// [`true`] if the type is signed.
/// ///
/// See also <code>FixedI32::[IS\_SIGNED][FixedI32::IS_SIGNED]</code> and
/// <code>FixedU32::[IS\_SIGNED][FixedU32::IS_SIGNED]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -105,6 +120,9 @@ impl<F: Fixed> Wrapping<F> {
/// The number of integer bits. /// The number of integer bits.
/// ///
/// See also <code>FixedI32::[INT\_NBITS][FixedI32::INT_NBITS]</code> and
/// <code>FixedU32::[INT\_NBITS][FixedU32::INT_NBITS]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -115,6 +133,9 @@ impl<F: Fixed> Wrapping<F> {
/// The number of fractional bits. /// The number of fractional bits.
/// ///
/// See also <code>FixedI32::[FRAC\_NBITS][FixedI32::FRAC_NBITS]</code> and
/// <code>FixedU32::[FRAC\_NBITS][FixedU32::FRAC_NBITS]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -126,6 +147,9 @@ impl<F: Fixed> Wrapping<F> {
/// Creates a fixed-point number that has a bitwise representation /// Creates a fixed-point number that has a bitwise representation
/// identical to the given integer. /// identical to the given integer.
/// ///
/// See also <code>FixedI32::[from\_bits][FixedI32::from_bits]</code> and
/// <code>FixedU32::[from\_bits][FixedU32::from_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -140,6 +164,9 @@ impl<F: Fixed> Wrapping<F> {
/// Creates an integer that has a bitwise representation identical /// Creates an integer that has a bitwise representation identical
/// to the given fixed-point number. /// to the given fixed-point number.
/// ///
/// See also <code>FixedI32::[to\_bits][FixedI32::to_bits]</code> and
/// <code>FixedU32::[to\_bits][FixedU32::to_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -155,6 +182,9 @@ impl<F: Fixed> Wrapping<F> {
/// Converts a fixed-point number from big endian to the targets /// Converts a fixed-point number from big endian to the targets
/// endianness. /// endianness.
/// ///
/// See also <code>FixedI32::[from\_be][FixedI32::from_be]</code> and
/// <code>FixedU32::[from\_be][FixedU32::from_be]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -174,6 +204,9 @@ impl<F: Fixed> Wrapping<F> {
/// Converts a fixed-point number from little endian to the /// Converts a fixed-point number from little endian to the
/// targets endianness. /// targets endianness.
/// ///
/// See also <code>FixedI32::[from\_le][FixedI32::from_le]</code> and
/// <code>FixedU32::[from\_le][FixedU32::from_le]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -192,6 +225,9 @@ impl<F: Fixed> Wrapping<F> {
/// Converts `self` to big endian from the targets endianness. /// Converts `self` to big endian from the targets endianness.
/// ///
/// See also <code>FixedI32::[to\_be][FixedI32::to_be]</code> and
/// <code>FixedU32::[to\_be][FixedU32::to_be]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -210,6 +246,9 @@ impl<F: Fixed> Wrapping<F> {
/// Converts `self` to little endian from the targets endianness. /// Converts `self` to little endian from the targets endianness.
/// ///
/// See also <code>FixedI32::[to\_le][FixedI32::to_le]</code> and
/// <code>FixedU32::[to\_le][FixedU32::to_le]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -228,6 +267,9 @@ impl<F: Fixed> Wrapping<F> {
/// Reverses the byte order of the fixed-point number. /// Reverses the byte order of the fixed-point number.
/// ///
/// See also <code>FixedI32::[swap\_bytes][FixedI32::swap_bytes]</code> and
/// <code>FixedU32::[swap\_bytes][FixedU32::swap_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -244,6 +286,10 @@ impl<F: Fixed> Wrapping<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in big endian. /// as a byte array in big endian.
/// ///
/// See also
/// <code>FixedI32::[from\_be\_bytes][FixedI32::from_be_bytes]</code> and
/// <code>FixedU32::[from\_be\_bytes][FixedU32::from_be_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -262,6 +308,10 @@ impl<F: Fixed> Wrapping<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in little endian. /// as a byte array in little endian.
/// ///
/// See also
/// <code>FixedI32::[from\_le\_bytes][FixedI32::from_le_bytes]</code> and
/// <code>FixedU32::[from\_le\_bytes][FixedU32::from_le_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -280,6 +330,10 @@ impl<F: Fixed> Wrapping<F> {
/// Creates a fixed-point number from its representation /// Creates a fixed-point number from its representation
/// as a byte array in native endian. /// as a byte array in native endian.
/// ///
/// See also
/// <code>FixedI32::[from\_ne\_bytes][FixedI32::from_ne_bytes]</code> and
/// <code>FixedU32::[from\_ne\_bytes][FixedU32::from_ne_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -302,6 +356,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in big-endian byte order. /// number as a byte array in big-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_be\_bytes][FixedI32::to_be_bytes]</code>
/// and <code>FixedU32::[to\_be\_bytes][FixedU32::to_be_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -319,6 +376,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in little-endian byte order. /// number as a byte array in little-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_le\_bytes][FixedI32::to_le_bytes]</code>
/// and <code>FixedU32::[to\_le\_bytes][FixedU32::to_le_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -336,6 +396,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the memory representation of this fixed-point /// Returns the memory representation of this fixed-point
/// number as a byte array in native-endian byte order. /// number as a byte array in native-endian byte order.
/// ///
/// See also <code>FixedI32::[to\_ne\_bytes][FixedI32::to_ne_bytes]</code>
/// and <code>FixedU32::[to\_ne\_bytes][FixedU32::to_ne_bytes]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -371,6 +434,9 @@ impl<F: Fixed> Wrapping<F> {
/// implemented, in which case this method returns /// implemented, in which case this method returns
/// <code>[Wrapping]\([src.wrapping_to_fixed()][ToFixed::wrapping_to_fixed])</code>. /// <code>[Wrapping]\([src.wrapping_to_fixed()][ToFixed::wrapping_to_fixed])</code>.
/// ///
/// See also <code>FixedI32::[from\_num][FixedI32::from_num]</code> and
/// <code>FixedU32::[from\_num][FixedU32::from_num]</code>.
///
/// # Panics /// # Panics
/// ///
/// For floating-point numbers, panics if the value is not [finite]. /// For floating-point numbers, panics if the value is not [finite].
@ -426,6 +492,9 @@ impl<F: Fixed> Wrapping<F> {
/// implemented, in which case this method returns /// implemented, in which case this method returns
/// [`Dst::wrapping_from_fixed(self.0)`][FromFixed::wrapping_from_fixed]. /// [`Dst::wrapping_from_fixed(self.0)`][FromFixed::wrapping_from_fixed].
/// ///
/// See also <code>FixedI32::[to\_num][FixedI32::to_num]</code> and
/// <code>FixedU32::[to\_num][FixedU32::to_num]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -457,6 +526,11 @@ impl<F: Fixed> Wrapping<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also
/// <code>FixedI32::[from\_str\_binary][FixedI32::from_str_binary]</code>
/// and
/// <code>FixedU32::[from\_str\_binary][FixedU32::from_str_binary]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -473,6 +547,10 @@ impl<F: Fixed> Wrapping<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also
/// <code>FixedI32::[from\_str\_octal][FixedI32::from_str_octal]</code> and
/// <code>FixedU32::[from\_str\_octal][FixedU32::from_str_octal]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -489,6 +567,9 @@ impl<F: Fixed> Wrapping<F> {
/// ///
/// Rounding is to the nearest, with ties rounded to even. /// Rounding is to the nearest, with ties rounded to even.
/// ///
/// See also <code>FixedI32::[from\_str\_hex][FixedI32::from_str_hex]</code>
/// and <code>FixedU32::[from\_str\_hex][FixedU32::from_str_hex]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -510,6 +591,9 @@ impl<F: Fixed> Wrapping<F> {
/// <code>[Wrapping]&lt;[I0F16]&gt;</code>, where the return value /// <code>[Wrapping]&lt;[I0F16]&gt;</code>, where the return value
/// is always zero. /// is always zero.
/// ///
/// See also <code>FixedI32::[int][FixedI32::int]</code> and
/// <code>FixedU32::[int][FixedU32::int]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -533,6 +617,9 @@ impl<F: Fixed> Wrapping<F> {
/// <code>[Wrapping]&lt;[I0F16]&gt;</code>, /// <code>[Wrapping]&lt;[I0F16]&gt;</code>,
/// where the return value is always equal to `self`. /// where the return value is always equal to `self`.
/// ///
/// See also <code>FixedI32::[frac][FixedI32::frac]</code> and
/// <code>FixedU32::[frac][FixedU32::frac]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -549,6 +636,10 @@ impl<F: Fixed> Wrapping<F> {
/// Rounds to the next integer towards 0. /// Rounds to the next integer towards 0.
/// ///
/// See also
/// <code>FixedI32::[round\_to\_zero][FixedI32::round_to_zero]</code> and
/// <code>FixedU32::[round\_to\_zero][FixedU32::round_to_zero]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -565,6 +656,9 @@ impl<F: Fixed> Wrapping<F> {
/// Wrapping ceil. Rounds to the next integer towards +∞, wrapping /// Wrapping ceil. Rounds to the next integer towards +∞, wrapping
/// on overflow. /// on overflow.
/// ///
/// See also <code>FixedI32::[ceil][FixedI32::ceil]</code> and
/// <code>FixedU32::[ceil][FixedU32::ceil]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -584,6 +678,9 @@ impl<F: Fixed> Wrapping<F> {
/// Overflow can only occur for signed numbers with zero integer /// Overflow can only occur for signed numbers with zero integer
/// bits. /// bits.
/// ///
/// See also <code>FixedI32::[floor][FixedI32::floor]</code> and
/// <code>FixedU32::[floor][FixedU32::floor]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -603,6 +700,9 @@ impl<F: Fixed> Wrapping<F> {
/// Wrapping round. Rounds to the next integer to the nearest, /// Wrapping round. Rounds to the next integer to the nearest,
/// with ties rounded away from zero, and wrapping on overflow. /// with ties rounded away from zero, and wrapping on overflow.
/// ///
/// See also <code>FixedI32::[round][FixedI32::round]</code> and
/// <code>FixedU32::[round][FixedU32::round]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -620,6 +720,11 @@ impl<F: Fixed> Wrapping<F> {
/// Wrapping round. Rounds to the next integer to the nearest, /// Wrapping round. Rounds to the next integer to the nearest,
/// with ties rounded to even, and wrapping on overflow. /// with ties rounded to even, and wrapping on overflow.
/// ///
/// See also
/// <code>FixedI32::[round\_ties\_to\_even][FixedI32::round_ties_to_even]</code>
/// and
/// <code>FixedU32::[round\_ties\_to\_even][FixedU32::round_ties_to_even]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -638,6 +743,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of ones in the binary representation. /// Returns the number of ones in the binary representation.
/// ///
/// See also <code>FixedI32::[count\_ones][FixedI32::count_ones]</code> and
/// <code>FixedU32::[count\_ones][FixedU32::count_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -652,6 +760,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of zeros in the binary representation. /// Returns the number of zeros in the binary representation.
/// ///
/// See also <code>FixedI32::[count\_zeros][FixedI32::count_zeros]</code>
/// and <code>FixedU32::[count\_zeros][FixedU32::count_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -666,6 +777,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of leading ones in the binary representation. /// Returns the number of leading ones in the binary representation.
/// ///
/// See also <code>FixedI32::[leading\_ones][FixedI32::leading_ones]</code>
/// and <code>FixedU32::[leading\_ones][FixedU32::leading_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -680,6 +794,10 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of leading zeros in the binary representation. /// Returns the number of leading zeros in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[leading\_zeros][FixedI32::leading_zeros]</code> and
/// <code>FixedU32::[leading\_zeros][FixedU32::leading_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -694,6 +812,10 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of trailing ones in the binary representation. /// Returns the number of trailing ones in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[trailing\_ones][FixedI32::trailing_ones]</code> and
/// <code>FixedU32::[trailing\_ones][FixedU32::trailing_ones]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -708,6 +830,10 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the number of trailing zeros in the binary representation. /// Returns the number of trailing zeros in the binary representation.
/// ///
/// See also
/// <code>FixedI32::[trailing\_zeros][FixedI32::trailing_zeros]</code> and
/// <code>FixedU32::[trailing\_zeros][FixedU32::trailing_zeros]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -722,6 +848,9 @@ impl<F: Fixed> Wrapping<F> {
/// Integer base-2 logarithm, rounded down. /// Integer base-2 logarithm, rounded down.
/// ///
/// See also <code>FixedI32::[int\_log2][FixedI32::int_log2]</code> and
/// <code>FixedU32::[int\_log2][FixedU32::int_log2]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the fixed-point number is ≤ 0. /// Panics if the fixed-point number is ≤ 0.
@ -732,6 +861,9 @@ impl<F: Fixed> Wrapping<F> {
/// Integer base-10 logarithm, rounded down. /// Integer base-10 logarithm, rounded down.
/// ///
/// See also <code>FixedI32::[int\_log10][FixedI32::int_log10]</code> and
/// <code>FixedU32::[int\_log10][FixedU32::int_log10]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the fixed-point number is ≤ 0. /// Panics if the fixed-point number is ≤ 0.
@ -742,6 +874,9 @@ impl<F: Fixed> Wrapping<F> {
/// Reverses the order of the bits of the fixed-point number. /// Reverses the order of the bits of the fixed-point number.
/// ///
/// See also <code>FixedI32::[reverse\_bits][FixedI32::reverse_bits]</code>
/// and <code>FixedU32::[reverse\_bits][FixedU32::reverse_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -757,6 +892,9 @@ impl<F: Fixed> Wrapping<F> {
/// Shifts to the left by `n` bits, wrapping the truncated bits to the right end. /// Shifts to the left by `n` bits, wrapping the truncated bits to the right end.
/// ///
/// See also <code>FixedI32::[rotate\_left][FixedI32::rotate_left]</code>
/// and <code>FixedU32::[rotate\_left][FixedU32::rotate_left]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -772,6 +910,9 @@ impl<F: Fixed> Wrapping<F> {
/// Shifts to the right by `n` bits, wrapping the truncated bits to the left end. /// Shifts to the right by `n` bits, wrapping the truncated bits to the left end.
/// ///
/// See also <code>FixedI32::[rotate\_right][FixedI32::rotate_right]</code>
/// and <code>FixedU32::[rotate\_right][FixedU32::rotate_right]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -787,6 +928,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the mean of `self` and `other`. /// Returns the mean of `self` and `other`.
/// ///
/// See also <code>FixedI32::[mean][FixedI32::mean]</code> and
/// <code>FixedU32::[mean][FixedU32::mean]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -804,6 +948,9 @@ impl<F: Fixed> Wrapping<F> {
/// Returns the reciprocal (inverse), 1/`self`. /// Returns the reciprocal (inverse), 1/`self`.
/// ///
/// See also <code>FixedI32::[recip][FixedI32::recip]</code> and
/// <code>FixedU32::[recip][FixedU32::recip]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if `self` is zero. /// Panics if `self` is zero.
@ -824,6 +971,9 @@ impl<F: Fixed> Wrapping<F> {
/// Multiply and add. Returns `self` × `mul` + `add`. /// Multiply and add. Returns `self` × `mul` + `add`.
/// ///
/// See also <code>FixedI32::[mul\_add][FixedI32::mul_add]</code> and
/// <code>FixedU32::[mul\_add][FixedU32::mul_add]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -843,6 +993,9 @@ impl<F: Fixed> Wrapping<F> {
/// Multiply and accumulate. Adds (`a` × `b`) to `self`. /// Multiply and accumulate. Adds (`a` × `b`) to `self`.
/// ///
/// See also <code>FixedI32::[mul\_acc][FixedI32::mul_acc]</code> and
/// <code>FixedU32::[mul\_acc][FixedU32::mul_acc]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -862,6 +1015,9 @@ impl<F: Fixed> Wrapping<F> {
/// Euclidean division. /// Euclidean division.
/// ///
/// See also <code>FixedI32::[div\_euclid][FixedI32::div_euclid]</code> and
/// <code>FixedU32::[div\_euclid][FixedU32::div_euclid]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -885,6 +1041,9 @@ impl<F: Fixed> Wrapping<F> {
/// Remainder for Euclidean division. /// Remainder for Euclidean division.
/// ///
/// See also <code>FixedI32::[rem\_euclid][FixedI32::rem_euclid]</code> and
/// <code>FixedU32::[rem\_euclid][FixedU32::rem_euclid]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -906,6 +1065,10 @@ impl<F: Fixed> Wrapping<F> {
/// Euclidean division by an integer. /// Euclidean division by an integer.
/// ///
/// See also
/// <code>FixedI32::[div\_euclid\_int][FixedI32::div_euclid_int]</code> and
/// <code>FixedU32::[div\_euclid\_int][FixedU32::div_euclid_int]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -927,6 +1090,10 @@ impl<F: Fixed> Wrapping<F> {
/// Remainder for Euclidean division. /// Remainder for Euclidean division.
/// ///
/// See also
/// <code>FixedI32::[rem\_euclid\_int][FixedI32::rem_euclid_int]</code> and
/// <code>FixedU32::[rem\_euclid\_int][FixedU32::rem_euclid_int]</code>.
///
/// # Panics /// # Panics
/// ///
/// Panics if the divisor is zero. /// Panics if the divisor is zero.
@ -953,6 +1120,8 @@ impl<F: FixedSigned> Wrapping<F> {
/// negative numbers, and an initial zero for non-negative /// negative numbers, and an initial zero for non-negative
/// numbers. /// numbers.
/// ///
/// See also <code>FixedI32::[signed\_bits][FixedI32::signed_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -972,6 +1141,8 @@ impl<F: FixedSigned> Wrapping<F> {
/// Returns [`true`] if the number is > 0. /// Returns [`true`] if the number is > 0.
/// ///
/// See also <code>FixedI32::[is\_positive][FixedI32::is_positive]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -987,6 +1158,8 @@ impl<F: FixedSigned> Wrapping<F> {
/// Returns [`true`] if the number is < 0. /// Returns [`true`] if the number is < 0.
/// ///
/// See also <code>FixedI32::[is\_negative][FixedI32::is_negative]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1006,6 +1179,8 @@ impl<F: FixedSigned> Wrapping<F> {
/// Overflow can only occur when trying to find the absolute value /// Overflow can only occur when trying to find the absolute value
/// of the minimum value. /// of the minimum value.
/// ///
/// See also <code>FixedI32::[abs][FixedI32::abs]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1035,6 +1210,8 @@ impl<F: FixedSigned> Wrapping<F> {
/// that for a positive number, 1 is returned, because +1 /// that for a positive number, 1 is returned, because +1
/// does not fit and is wrapped to 1. /// does not fit and is wrapped to 1.
/// ///
/// See also <code>FixedI32::[signum][FixedI32::signum]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1062,6 +1239,9 @@ impl<F: FixedSigned> Wrapping<F> {
impl<F: FixedUnsigned> Wrapping<F> { impl<F: FixedUnsigned> Wrapping<F> {
/// Returns the number of bits required to represent the value. /// Returns the number of bits required to represent the value.
/// ///
/// See also
/// <code>FixedU32::[significant\_bits][FixedU32::significant_bits]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1079,6 +1259,9 @@ impl<F: FixedUnsigned> Wrapping<F> {
/// Returns [`true`] if the fixed-point number is /// Returns [`true`] if the fixed-point number is
/// 2<sup><i>k</i></sup> for some integer <i>k</i>. /// 2<sup><i>k</i></sup> for some integer <i>k</i>.
/// ///
/// See also
/// <code>FixedU32::[is\_power\_of\_two][FixedU32::is_power_of_two]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1098,6 +1281,8 @@ impl<F: FixedUnsigned> Wrapping<F> {
/// If `self` > 0, the highest one is equal to the largest power /// If `self` > 0, the highest one is equal to the largest power
/// of two that is ≤ `self`. /// of two that is ≤ `self`.
/// ///
/// See also <code>FixedU32::[highest\_one][FixedU32::highest_one]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
@ -1118,6 +1303,9 @@ impl<F: FixedUnsigned> Wrapping<F> {
/// ///
/// If the next power of two is too large to fit, it is wrapped to zero. /// If the next power of two is too large to fit, it is wrapped to zero.
/// ///
/// See also
/// <code>FixedU32::[next\_power\_of\_two][FixedU32::next_power_of_two]</code>.
///
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust