Struct aluvm::data::Number[][src]

pub struct Number { /* fields omitted */ }
Expand description

Type holding number of any layout

Implementations

Does comparison by ignoring the difference in the last bit of significand for float layouts. For integers performs normal comparison.

Checks for the equality ignoring the difference in the last bit of significand for float layouts. For integers performs normal comparison.

Addition of two integers with configuration flags for overflow and signed format.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Subtraction of two integers with configuration flags for overflow and signed format.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Multiplication of two integers with configuration flags for overflow and signed format.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Division of two integers with configuration flags for overflow and signed format.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Addition of two floats with configuration flags for rounding.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Subtraction of two floats with configuration flags for rounding.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Multiplication of two floats with configuration flags for rounding.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Division of two floats with configuration flags for rounding.

Panics

  • if applied to float number layouts
  • if numbers in arguments has different layout.

Returns the absolute value of the number

Cyclic bit shift left. Panics if the number is not an integer.

Cyclic bit shift right. Panics if the number is not an integer.

Bit shift right for signed value. Panics if the number is not an integer.

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

Creates zero value with a given layout

Creates value with the specified bit masked

Constructs number representation from a slice and a given layout.

Fails returning None if the length of slice does not match the required layout byte length.

Constructs value from slice of bytes.

Panics if the length of the slice is greater than 1024 bytes.

Returns length of the used portion of the value

Returns number layout used by the value

Returns the number of zeros in the binary representation of self.

Returns the number of ones in the binary representation of self.

Measures minimum number of bits required to store the number. For float layouts, always matches the layout bit size.

Detects if the number value positive (i.e. >0) or not.

Detects if the value is equal to zero

Detects if the value is NaN. For integer layouts always false

Detects if the value is equal to the maximum possible value for the used layout. For floats, always false.

Ensures that all non-value bits are set to zero

Returns a copy where all non-value bits are set to zero

Transforms internal value layout returning whether this was possible without discarding any bit information

Adds or removes negative sign to the number (negates negative or positive number, depending on the method argument value)

Removes negative sign if present (negates negative number)

Trait Implementations

Performs the conversion.

Performs the conversion.

The resulting type after applying the & operator.

Performs the & operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

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

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

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

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Formats the value using the given formatter.

Formats the value using the given formatter.

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

Formats the value using the given formatter.

Since we always convert NaN values into None and keep them at the level of MaybeNumber, we can do strict ordering even on float numbers

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

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

The resulting type after applying the % operator.

Performs the % operation. Read more

The resulting type after applying the << operator.

Performs the << operation. Read more

The resulting type after applying the >> operator.

Performs the >> operation. Read more

Formats the value using the given formatter.

Formats the value using the given formatter.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Calculate the base32 serialized length

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Error type if conversion fails

Check if all values are in range and return array-like struct of u5 values

Performs the conversion.

Performs the conversion.

Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more

Convert Self to base32 vector

Outputs the hash in hexadecimal form

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

Converts the given value to a String. 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.