UNPKG

460 BTypeScriptView Raw
1/// <reference types="bn.js" />
2import type { ToBn } from '../types.js';
3import { BN } from './bn.js';
4/**
5 * @name bnSqrt
6 * @summary Calculates the integer square root of a BN
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import BN from 'bn.js';
12 * import { bnSqrt } from '@polkadot/util';
13 *
14 * bnSqrt(new BN(16)).toString(); // => '4'
15 * ```
16 */
17export declare function bnSqrt<ExtToBn extends ToBn>(value: ExtToBn | BN | bigint | string | number | null): BN;