UNPKG

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