package
Version:
v0.0.0-...-64e3b6a
Opens a new window with list of versions in this module.
Published: Feb 26, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
Documentation
¶
Package math provides access to useful numeric functions available in Neo VM.
Abs returns an absolute value of a.
Max returns the maximum of a, b.
Min returns the minimum of a, b.
func ModMul(a, b, mod int) int
ModMul returns the result of modulus division on a*b.
func ModPow(a, b, mod int) int
ModPow returns the result of modulus division on a^b. If b is -1,
it returns the modular inverse of a.
Pow returns a^b using POW VM opcode.
b must be >= 0 and <= 2^31-1.
Sign returns:
-1 if x < 0
0 if x == 0
+1 if x > 0
Sqrt returns a positive square root of x rounded down.
Within returns true if a <= x < b.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.