Skip to main content

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

NameType
yScalar

Returns

Scalar

Defined in

snarky.d.ts:598


div

div(y): Scalar

Divide scalar field elements. Can only be called outside of circuit execution

Parameters

NameType
yScalar

Returns

Scalar

Defined in

snarky.d.ts:616


mul

mul(y): Scalar

Multiply scalar field elements. Can only be called outside of circuit execution

Parameters

NameType
yScalar

Returns

Scalar

Defined in

snarky.d.ts:610


neg

neg(): Scalar

Negate a scalar field element. Can only be called outside of circuit execution

Returns

Scalar

Defined in

snarky.d.ts:592


sub

sub(y): Scalar

Subtract scalar field elements. Can only be called outside of circuit execution

Parameters

NameType
yScalar

Returns

Scalar

Defined in

snarky.d.ts:604


toFields

toFields(this): Field[]

Parameters

NameType
thisScalar

Returns

Field[]

Defined in

snarky.d.ts:586


toJSON

toJSON(): JSONValue

Returns

JSONValue

Defined in

snarky.d.ts:618


check

Static check(x): void

Parameters

NameType
xScalar

Returns

void

Defined in

snarky.d.ts:628


fromJSON

Static fromJSON(x): null | Scalar

Parameters

NameType
xJSONValue

Returns

null | Scalar

Defined in

snarky.d.ts:627


ofBits

Static ofBits(bits): Scalar

Parameters

NameType
bitsBool[]

Returns

Scalar

Defined in

snarky.d.ts:623


ofFields

Static ofFields(fields): Scalar

Parameters

NameType
fieldsField[]

Returns

Scalar

Defined in

snarky.d.ts:621


random

Static random(): Scalar

Returns

Scalar

Defined in

snarky.d.ts:624


sizeInFields

Static sizeInFields(): number

Returns

number

Defined in

snarky.d.ts:622


toFields

Static toFields(x): Field[]

Parameters

NameType
xScalar

Returns

Field[]

Defined in

snarky.d.ts:620


toJSON

Static toJSON(x): JSONValue

Parameters

NameType
xScalar

Returns

JSONValue

Defined in

snarky.d.ts:626