pub trait Sign {
    fn sign(&self) -> Ordering;
}
Expand description

Returns Greater, Equal, or Less, depending on whether a number is positive, zero, or negative, respectively.

Required Methods

Implementations on Foreign Types

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

Returns Greater, Equal, or Less, depending on whether the number is positive, zero, or negative, respectively.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

  • Positive finite numbers, positive zero, and positive infinity have sign Greater.
  • Negative finite numbers, negative zero, and negative infinity have sign Less.
  • NaN has sign Equal.
Worst-case complexity

Constant time and additional memory.

Examples

See here.

Compares a number to zero.

  • Positive finite numbers, positive zero, and positive infinity have sign Greater.
  • Negative finite numbers, negative zero, and negative infinity have sign Less.
  • NaN has sign Equal.
Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors