b-num-roots-in-range
▸ function bNumRootsInRange
(p
: bigint[], a
: bigint, b
: bigint): number
Defined in roots/descartes/bigint/b-num-roots-in-range.ts:32
Returns the exact number of distinct real roots in the open interval (a,b) of the given polynomial.
example
const p = [1n, 1n, -64n, 236n, -240n];
bNumRootsInRange(p,-20,-11); //=> 0
bNumRootsInRange(p,-11,-9); //=> 1
bNumRootsInRange(p,-11,3.5); //=> 3
bNumRootsInRange(p,-11,5); //=> 4
Parameters:
Name | Type | Description |
---|---|---|
p | bigint[] | a polynomial with coefficients given densely as an array of bigints from highest to lowest power, e.g. [5n,-3n,0n] represents the polynomial 5x^2 - 3x |
a | bigint | a lower bound |
b | bigint | an upper bound |
Returns: number