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

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

Deno / TypeScript to Ethereum Connector
Latest
method BigNumber.prototype.isEqualTo
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.isEqualTo('1e-324')                  // false
BigNumber(-0).isEqualTo(x)             // true  ( -0 === 0 )
BigNumber(255).isEqualTo('ff', 16)     // true

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

Parameters

n: BigNumber.Value

A numeric value.

optional
base: number

Returns

boolean