pub trait Sign {
// Required method
fn sign(&self) -> Ordering;
}
Expand description
Returns Greater
, Equal
, or Less
, depending on whether a number is positive, zero, or
negative, respectively.
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.
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.