Class: Scalar
Table of contents
Constructors
Methods
Constructors
constructor
• new Scalar()
Methods
add
▸ add(y
): Scalar
Add scalar field elements. Can only be called outside of circuit execution
Parameters
Name | Type |
---|---|
y | Scalar |
Returns
Defined in
div
▸ div(y
): Scalar
Divide scalar field elements. Can only be called outside of circuit execution
Parameters
Name | Type |
---|---|
y | Scalar |
Returns
Defined in
mul
▸ mul(y
): Scalar
Multiply scalar field elements. Can only be called outside of circuit execution
Parameters
Name | Type |
---|---|
y | Scalar |
Returns
Defined in
neg
▸ neg(): Scalar
Negate a scalar field element. Can only be called outside of circuit execution
Returns
Defined in
sub
▸ sub(y
): Scalar
Subtract scalar field elements. Can only be called outside of circuit execution
Parameters
Name | Type |
---|---|
y | Scalar |
Returns
Defined in
toFields
▸ toFields(this
): Field
[]
Parameters
Name | Type |
---|---|
this | Scalar |
Returns
Field
[]
Defined in
toJSON
▸ toJSON(): JSONValue
Returns
JSONValue
Defined in
check
▸ Static
check(x
): void
Parameters
Name | Type |
---|---|
x | Scalar |
Returns
void
Defined in
fromJSON
▸ Static
fromJSON(x
): null
| Scalar
Parameters
Name | Type |
---|---|
x | JSONValue |
Returns
null
| Scalar
Defined in
ofBits
▸ Static
ofBits(bits
): Scalar
Parameters
Name | Type |
---|---|
bits | Bool [] |
Returns
Defined in
ofFields
▸ Static
ofFields(fields
): Scalar
Parameters
Name | Type |
---|---|
fields | Field [] |
Returns
Defined in
random
▸ Static
random(): Scalar
Returns
Defined in
sizeInFields
▸ Static
sizeInFields(): number
Returns
number
Defined in
toFields
▸ Static
toFields(x
): Field
[]
Parameters
Name | Type |
---|---|
x | Scalar |
Returns
Field
[]
Defined in
toJSON
▸ Static
toJSON(x
): JSONValue
Parameters
Name | Type |
---|---|
x | Scalar |
Returns
JSONValue