Skip to main content Link Search Menu Expand Document (external link)

BigInt overview

A simple extension to the Effect BigInt module


Table of contents


Constructors

fromPrimitive

Constructs an Either of a bigint from a number. Will only return a left if the number is NaN, Infinity or not an integer.

Signature

export declare const fromPrimitive: (i: string | number | boolean) => Either.Either<bigint, Brand.Brand.BrandErrors>

fromPrimitiveOption

Constructs an Option of a bigint from a number. Will only return a none if the number is NaN, Infinity or not an integer.

Signature

export declare const fromPrimitiveOption: MTypes.OneArgFunction<string | number | boolean, Option.Option<bigint>>

fromPrimitiveOrThrow

Constructs a bigint from a number. Will only throw if the number is NaN, Infinity or not an integer.

Signature

export declare const fromPrimitiveOrThrow: MTypes.OneArgFunction<string | number | boolean, bigint>

Destructors

log10

Calculates the base-10 log of a bigint

Signature

export declare const log10: MTypes.OneArgFunction<bigint, Option.Option<number>>

unsafeLog10

Calculates the base-10 log of a bigint

Signature

export declare const unsafeLog10: (self: bigint) => number

Predicates

isEven

Returns true if self is even

Signature

export declare const isEven: Predicate.Predicate<bigint>

isNegative

Returns true if self is negative

Signature

export declare const isNegative: Predicate.Predicate<bigint>

isOdd

Returns true if self is even

Signature

export declare const isOdd: Predicate.Predicate<bigint>

isPositive

Returns true if self is positive

Signature

export declare const isPositive: Predicate.Predicate<bigint>

isZero

Returns true if self is zero

Signature

export declare const isZero: Predicate.Predicate<bigint>