Expand description
Traits for generic numeric constants
Like the traits Zero
and One
from the num
crate, but for all natural
numbers up to and including 100. Allows doing generic arithmetic without
having to do casts.
Without this crate you’d need to do something like:
ⓘ
2u8.into() * 3u8.into() + 4u8.into()
Which is okay, but obfuscates a bit what the intent is.
With this crate you can do something like this:
ⓘ
T::two() * T::three() + T::four()
The traits are implemented for all standard numeric types, as well as a blanket
implementation for num::Complex<T>
, where T
is any of the standar numeric
types.
Structs§
- Complex
- A complex number in Cartesian form.
Traits§
- Eight
- Returns the constant value for the number eight
- Eighteen
- Returns the constant value for the number eighteen
- Eighty
- Returns the constant value for the number eighty
- Eighty
Eight - Returns the constant value for the number eighty_eight
- Eighty
Five - Returns the constant value for the number eighty_five
- Eighty
Four - Returns the constant value for the number eighty_four
- Eighty
Nine - Returns the constant value for the number eighty_nine
- Eighty
One - Returns the constant value for the number eighty_one
- Eighty
Seven - Returns the constant value for the number eighty_seven
- Eighty
Six - Returns the constant value for the number eighty_six
- Eighty
Three - Returns the constant value for the number eighty_three
- Eighty
Two - Returns the constant value for the number eighty_two
- Eleven
- Returns the constant value for the number eleven
- Fifteen
- Returns the constant value for the number fifteen
- Fifty
- Returns the constant value for the number fifty
- Fifty
Eight - Returns the constant value for the number fifty_eight
- Fifty
Five - Returns the constant value for the number fifty_five
- Fifty
Four - Returns the constant value for the number fifty_four
- Fifty
Nine - Returns the constant value for the number fifty_nine
- Fifty
One - Returns the constant value for the number fifty_one
- Fifty
Seven - Returns the constant value for the number fifty_seven
- Fifty
Six - Returns the constant value for the number fifty_six
- Fifty
Three - Returns the constant value for the number fifty_three
- Fifty
Two - Returns the constant value for the number fifty_two
- Five
- Returns the constant value for the number five
- Forty
- Returns the constant value for the number forty
- Forty
Eight - Returns the constant value for the number forty_eight
- Forty
Five - Returns the constant value for the number forty_five
- Forty
Four - Returns the constant value for the number forty_four
- Forty
Nine - Returns the constant value for the number forty_nine
- Forty
One - Returns the constant value for the number forty_one
- Forty
Seven - Returns the constant value for the number forty_seven
- Forty
Six - Returns the constant value for the number forty_six
- Forty
Three - Returns the constant value for the number forty_three
- Forty
Two - Returns the constant value for the number forty_two
- Four
- Returns the constant value for the number four
- Fourteen
- Returns the constant value for the number fourteen
- Nine
- Returns the constant value for the number nine
- Nineteen
- Returns the constant value for the number nineteen
- Ninety
- Returns the constant value for the number ninety
- Ninety
Eight - Returns the constant value for the number ninety_eight
- Ninety
Five - Returns the constant value for the number ninety_five
- Ninety
Four - Returns the constant value for the number ninety_four
- Ninety
Nine - Returns the constant value for the number ninety_nine
- Ninety
One - Returns the constant value for the number ninety_one
- Ninety
Seven - Returns the constant value for the number ninety_seven
- Ninety
Six - Returns the constant value for the number ninety_six
- Ninety
Three - Returns the constant value for the number ninety_three
- Ninety
Two - Returns the constant value for the number ninety_two
- One
- Defines a multiplicative identity element for
Self
. - OneHundred
- Returns the constant value for the number one_hundred
- Seven
- Returns the constant value for the number seven
- Seventeen
- Returns the constant value for the number seventeen
- Seventy
- Returns the constant value for the number seventy
- Seventy
Eight - Returns the constant value for the number seventy_eight
- Seventy
Five - Returns the constant value for the number seventy_five
- Seventy
Four - Returns the constant value for the number seventy_four
- Seventy
Nine - Returns the constant value for the number seventy_nine
- Seventy
One - Returns the constant value for the number seventy_one
- Seventy
Seven - Returns the constant value for the number seventy_seven
- Seventy
Six - Returns the constant value for the number seventy_six
- Seventy
Three - Returns the constant value for the number seventy_three
- Seventy
Two - Returns the constant value for the number seventy_two
- Six
- Returns the constant value for the number six
- Sixteen
- Returns the constant value for the number sixteen
- Sixty
- Returns the constant value for the number sixty
- Sixty
Eight - Returns the constant value for the number sixty_eight
- Sixty
Five - Returns the constant value for the number sixty_five
- Sixty
Four - Returns the constant value for the number sixty_four
- Sixty
Nine - Returns the constant value for the number sixty_nine
- Sixty
One - Returns the constant value for the number sixty_one
- Sixty
Seven - Returns the constant value for the number sixty_seven
- Sixty
Six - Returns the constant value for the number sixty_six
- Sixty
Three - Returns the constant value for the number sixty_three
- Sixty
Two - Returns the constant value for the number sixty_two
- Ten
- Returns the constant value for the number ten
- Thirteen
- Returns the constant value for the number thirteen
- Thirty
- Returns the constant value for the number thirty
- Thirty
Eight - Returns the constant value for the number thirty_eight
- Thirty
Five - Returns the constant value for the number thirty_five
- Thirty
Four - Returns the constant value for the number thirty_four
- Thirty
Nine - Returns the constant value for the number thirty_nine
- Thirty
One - Returns the constant value for the number thirty_one
- Thirty
Seven - Returns the constant value for the number thirty_seven
- Thirty
Six - Returns the constant value for the number thirty_six
- Thirty
Three - Returns the constant value for the number thirty_three
- Thirty
Two - Returns the constant value for the number thirty_two
- Three
- Returns the constant value for the number three
- Twelve
- Returns the constant value for the number twelve
- Twenty
- Returns the constant value for the number twenty
- Twenty
Eight - Returns the constant value for the number twenty_eight
- Twenty
Five - Returns the constant value for the number twenty_five
- Twenty
Four - Returns the constant value for the number twenty_four
- Twenty
Nine - Returns the constant value for the number twenty_nine
- Twenty
One - Returns the constant value for the number twenty_one
- Twenty
Seven - Returns the constant value for the number twenty_seven
- Twenty
Six - Returns the constant value for the number twenty_six
- Twenty
Three - Returns the constant value for the number twenty_three
- Twenty
Two - Returns the constant value for the number twenty_two
- Two
- Returns the constant value for the number two
- Zero
- Defines an additive identity element for
Self
.