UNPKG

2.16 kBTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2import { DoubleNextConstraints } from './_next/doubleNext';
3/**
4 * Constraints to be applied on {@link double}
5 * @remarks Since 2.6.0
6 * @public
7 */
8export declare type DoubleConstraints = {
9 /**
10 * Enable new version of fc.double
11 * @remarks Since 2.8.0
12 */
13 next?: false;
14 /**
15 * Lower bound for the generated doubles (included)
16 * @remarks Since 2.6.0
17 */
18 min?: number;
19 /**
20 * Upper bound for the generated doubles (excluded)
21 * @remarks Since 2.6.0
22 */
23 max?: number;
24} | ({
25 /**
26 * Enable new version of fc.double
27 * @remarks Since 2.8.0
28 */
29 next: true;
30} & DoubleNextConstraints);
31/**
32 * For floating point numbers between 0.0 (included) and 1.0 (excluded) - accuracy of `1 / 2**53`
33 * @remarks Since 0.0.6
34 * @public
35 */
36declare function double(): Arbitrary<number>;
37/**
38 * For floating point numbers between 0.0 (included) and max (excluded) - accuracy of `max / 2**53`
39 *
40 * @param max - Upper bound of the generated floating point
41 *
42 * @deprecated
43 * Superceded by `fc.double({max})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
44 * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
45 *
46 * @remarks Since 1.0.0
47 * @public
48 */
49declare function double(max: number): Arbitrary<number>;
50/**
51 * For floating point numbers between min (included) and max (excluded) - accuracy of `(max - min) / 2**53`
52 *
53 * @param min - Lower bound of the generated floating point
54 * @param max - Upper bound of the generated floating point
55 *
56 * @remarks You may prefer to use `fc.double({min, max})` instead.
57 * @remarks Since 1.0.0
58 * @public
59 */
60declare function double(min: number, max: number): Arbitrary<number>;
61/**
62 * For floating point numbers in range defined by constraints - accuracy of `(max - min) / 2**53`
63 *
64 * @param constraints - Constraints to apply when building instances
65 *
66 * @remarks Since 2.6.0
67 * @public
68 */
69declare function double(constraints: DoubleConstraints): Arbitrary<number>;
70export { double };