This method attempts to decode a VM Number, a format in which numeric values
are represented on the stack. (The Satoshi implementation calls this
CScriptNum.)
If bytes is a valid VM Number, this method returns the represented number
in BigInt format. If bytes is not valid, a VmNumberError
is returned.
All common operations accepting numeric parameters or pushing numeric values
to the stack currently use the VM Number format. The binary format of numbers
wouldn't be important if they could only be operated on by arithmetic
operators, but since the results of these operations may become input to
other operations (e.g. hashing), the specific representation is consensus-
critical.
This method attempts to decode a VM Number, a format in which numeric values are represented on the stack. (The Satoshi implementation calls this
CScriptNum
.)If
bytes
is a valid VM Number, this method returns the represented number in BigInt format. Ifbytes
is not valid, a VmNumberError is returned.All common operations accepting numeric parameters or pushing numeric values to the stack currently use the VM Number format. The binary format of numbers wouldn't be important if they could only be operated on by arithmetic operators, but since the results of these operations may become input to other operations (e.g. hashing), the specific representation is consensus- critical.
For the reverse, see bigIntToVmNumber.