Struct fixed::F128Bits[][src]

#[repr(transparent)]
pub struct F128Bits(pub u128);
Expand description

The bit representation of a binary128 floating-point number (f128).

This type can be used to

  • convert between fixed-point numbers and the bit representation of 128-bit floating-point numbers.
  • compare fixed-point numbers and the bit representation of 128-bit floating-point numbers.

Examples

use fixed::{types::I16F16, F128Bits};
// binary128 representation for 1.0 is 0x3FFF << 112
let one = F128Bits(0x3FFF_u128 << 112);

assert_eq!(I16F16::ONE.to_num::<F128Bits>(), one);
assert_eq!(I16F16::from_num(one), I16F16::ONE);

// fixed-point numbers can be compared directly to F128Bits values
assert!(I16F16::from_num(1.5) > one);
assert!(I16F16::from_num(0.5) < one);

Tuple Fields

0: u128

Trait Implementations

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) and does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

Rounding is to the nearest, with ties rounded to even.

Panics

When debug assertions are enabled, panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_from_fixed instead.

Converts a fixed-point number to a floating-point number if it fits, otherwise returns None.

Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number, saturating if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number, wrapping if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

Returns a tuple of the value and a bool indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number, panicking if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if the value does not fit, even when debug assertions are not enabled.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion actually never fails (infallible) but does not lose any precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion actually never fails (infallible) and does not lose precision (lossless).

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts a fixed-point number to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts an integer to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts an integer to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) and actually does not lose precision (lossless).

Converts an integer to a floating-point number.

This conversion never fails (infallible) but may lose precision (lossy). Rounding is to the nearest, with ties rounded to even.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Converts a floating-point number to a fixed-point number.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if self is not finite.

When debug assertions are enabled, also panics if the value does not fit. When debug assertions are not enabled, the wrapped value can be returned, but it is not considered a breaking change if in the future it panics; if wrapping is required use wrapping_to_fixed instead.

Converts a floating-point number to a fixed-point number if it fits, otherwise returns None.

Rounding is to the nearest, with ties rounded to even.

Converts a floating-point number to a fixed-point number, saturating if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if self is NaN.

Converts a floating-point number to a fixed-point number, wrapping if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if self is not finite.

Converts a floating-point number to a fixed-point number.

Returns a tuple of the fixed-point number and a bool indicating whether an overflow has occurred. On overflow, the wrapped value is returned.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if self is not finite.

Converts a floating-point number to a fixed-point number, panicking if it does not fit.

Rounding is to the nearest, with ties rounded to even.

Panics

Panics if self is not finite or if the value does not fit, even when debug assertions are not enabled.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.