Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/web3/types/bignumber.d.ts>BigNumber#eq

Deno / TypeScript to Ethereum Connector
Latest
method BigNumber.prototype.eq
import { BigNumber } from "https://deno.land/x/web3@v0.11.1/types/bignumber.d.ts";

Returns true if the value of this BigNumber is equal to the value of n, otherwise returns false.

As with JavaScript, NaN does not equal NaN.

0 === 1e-324                    // true
x = new BigNumber(0)
x.eq('1e-324')                  // false
BigNumber(-0).eq(x)             // true  ( -0 === 0 )
BigNumber(255).eq('ff', 16)     // true

y = new BigNumber(NaN)
y.eq(NaN)                       // false

Parameters

n: BigNumber.Value

A numeric value.

optional
base: number

Returns

boolean