Skip to content

BigInt

Extends: PlutusData < Resource

Description

This class is used for representing both positive and negative integers of arbitrary size. You should not create a BigInt(BigInt) to get those numbers.

This class is used for representing both positive and negative integers of arbitrary size. You should not create a BigInt(BigInt) to get those numbers.

Constants Descriptions

Status

enum Status{SUCCESS = 0, COULD_NOT_PARSE_BIGINT = 1, COULD_NOT_DESERIALIZE_BIGINT = 2}

Property Descriptions

value

@export var value: String
  • Setter: @value_setter
  • Getter: @value_getter

Method Descriptions

_init

func _init(b: _BigInt = null) -> BigInt

add

func add(other: BigInt) -> BigInt

Return the result of adding [param other].

mul

func mul(other: BigInt) -> BigInt

Return the result of multiplying by [param other].

eq

func eq(other: BigInt) -> bool

Check if is equal to [param other].

lt

func lt(other: BigInt) -> bool

Check if it is less than [param other].

gt

func gt(other: BigInt) -> bool

Check if it is greater than [param other].

negate

func negate() -> BigInt

Return the additive inverse.

sub

func sub(other: BigInt) -> BigInt

Return the result of substracting [param other].

to_str

func to_str() -> String

Convert to [String].

to_int

func to_int() -> int

format_price

func format_price(quantity_decimals: float = 6, format_decimals: int = 2) -> String

from_str (static)

func from_str(s: String) -> ConversionResult

Create a BigInt(BigInt).

from_int (static)

func from_int(n: int) -> BigInt

Convert an [int] into a BigInt.

zero (static)

func zero() -> BigInt

Return 0

one (static)

func one() -> BigInt

Return 1

Sub-classes

ConversionResult

Property Descriptions

value

var value: BigInt
  • Getter: @value_getter

WARNING: This function may fail! First match on Result.tag or call Result.is_ok.

error

var error: String
  • Getter: @error_getter

WARNING: This function may fail! First match on Result.tag or call Result._is_err.