Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigFloatToBigInt ¶
BigFloatToBigInt converts big.Float values to big.Int values. This function is required because big.NewInt() simply casts to uint64, and is thus bounded by that type's maximum size, i.e. math.MaxUint64 or 18446744073709551615. To get around this, we use the Int() method on big.Float to directly store large values into a big.Int.
func FromOrdinal ¶ added in v0.5.0
FromOrdinal will return the integral form of the caller- supplied ordinal string, e.g., FromOrdinal("11th") will return 11, with err set in case a parse error occurs.
func Ordinal ¶ added in v0.5.0
func Ordinal[T constraints.Integer](n T) string
Ordinal converts the generic integer type to a string ordinal, e.g., Ordinal(3) returns "3rd". Although any integeral type is accepted, internally it is treated as an int because the mod operator cannot be used with generically constrained types. Thus, whatever is passed in is converted to an int. Moreover, the absolute valus is taken, so Ordinal(-1) will return "1st".
Types ¶
This section is empty.