Documentation ¶
Index ¶
- Constants
- func DecimalPlaces(value float64, prec int) float64
- func DecimalPlacesRound(value float64, rank int) float64
- func FormatFloat(num float64) string
- func FormatInt(i int64, base int) string
- func FormatUint(i uint64, base int) string
- func GenKey(key int64) int64
- func PackInt(v int) uint64
- func ParseInt(s string, base int, bitSize int) (i int64, err error)
- func ParseUint(s string, base int, bitSize int) (uint64, error)
- func SecondKey() int64
- func StandardDeviation[S ~[]T, T constraintsi.Number](data S, isSample bool) float64
- func UnpackInt(v uint64) int
- func ValidateKey(key, secretKey int64) float64
- func ValidateSecondKey(key int64) float64
- func Variance[S ~[]T, T constraintsi.Number](data S, isSample bool) float64
Constants ¶
const ( MinInt48 int64 = -(1 << 47) MaxInt48 int64 = +(1 << 47) - 1 )
Variables ¶
This section is empty.
Functions ¶
func DecimalPlaces ¶
func FormatFloat ¶
func FormatInt ¶
FormatInt returns the string representation of i in the given base, for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z' for digit values >= 10.
func FormatUint ¶ added in v0.0.18
FormatUint returns the string representation of i in the given base, for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z' for digit values >= 10.
func ParseInt ¶
ParseInt interprets a string s in the given base (0, 2 to 36) and bit size (0 to 64) and returns the corresponding value i.
The string may begin with a leading sign: "+" or "-".
If the base argument is 0, the true base is implied by the string's prefix following the sign (if present): 2 for "0b", 8 for "0" or "0o", 16 for "0x", and 10 otherwise. Also, for argument base 0 only, underscore characters are permitted as defined by the Go syntax for integer literals.
The bitSize argument specifies the integer type that the result must fit into. Bit sizes 0, 8, 16, 32, and 64 correspond to int, int8, int16, int32, and int64. If bitSize is below 0 or above 64, an error is returned.
The errors that ParseInt returns have concrete type *NumError and include err.Num = s. If s is empty or contains invalid digits, err.Err = ErrSyntax and the returned value is 0; if the value corresponding to s cannot be represented by a signed integer of the given size, err.Err = ErrRange and the returned value is the maximum magnitude integer of the appropriate bitSize and sign.
func StandardDeviation ¶ added in v0.3.1
func StandardDeviation[S ~[]T, T constraintsi.Number](data S, isSample bool) float64
func ValidateKey ¶
func ValidateSecondKey ¶
Types ¶
This section is empty.