Expand description
Seximal is a collection of structs that represent the seximal (base6) equivalents of all the number types in Rust.
Every type in this crate supports arithmetic operations with itself or the equivalent decimal type using the normal arithmetic operators. Every type can also be compared with itself using std::cmp.
You can use the new function in each struct to create a new instance from a decimal number. Alternatively a new instance can be created from a string representation of a seximal number with the from function. Becuse the value is stored internally as a decimal number type, new is always the quicker option. However, from should be used when creating a new instance from user input, for example, as it performs the conversion from seximal to decimal for you.
The value function in each struct gives you the value of the number in decimal form. Each struct implements fmt::Display which returns a string representation of the value in seximal form.
All the integer types have functions for converting between them. You can even convert between signed and unsigned types. The two floating point types support conversions between each other. Be careful, however, as these functions perform just like the as keyword, which means that overflow will result in a panic.
Structsยง
- Sf52
Sf52is the seximal equivalent off32.- Sf144
Sf144is the seximal equivalent off64.- Si12
Si12is the seximal equivalent ofi8.- Si24
Si24is the seximal equivalent ofi16.- Si52
Si52is the seximal equivalent ofi32.- Si144
Si144is the seximal equivalent ofi64.- Si332
Si332is the seximal equivalent ofi128.- Sisize
Sisizeis the seximal equivalent ofisize.- Su12
Su12is the seximal equivalent ofu8.- Su24
Su24is the seximal equivalent ofu16.- Su52
Su52is the seximal equivalent ofu32.- Su144
Su144is the seximal equivalent ofu64.- Su332
Su332is the seximal equivalent ofu128.- Susize
Susizeis the seximal equivalent ofusize.