1 | import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
|
2 | import { FloatNextConstraints } from './_next/floatNext';
|
3 | /**
|
4 | * Constraints to be applied on {@link float}
|
5 | * @remarks Since 2.6.0
|
6 | * @public
|
7 | */
|
8 | export declare type FloatConstraints = {
|
9 | /**
|
10 | * Enable new version of fc.float
|
11 | * @remarks Since 2.8.0
|
12 | */
|
13 | next?: false;
|
14 | /**
|
15 | * Lower bound for the generated floats (included)
|
16 | * @remarks Since 2.6.0
|
17 | */
|
18 | min?: number;
|
19 | /**
|
20 | * Upper bound for the generated floats (excluded)
|
21 | * @remarks Since 2.6.0
|
22 | */
|
23 | max?: number;
|
24 | } | ({
|
25 | /**
|
26 | * Enable new version of fc.float
|
27 | * @remarks Since 2.8.0
|
28 | */
|
29 | next: true;
|
30 | } & FloatNextConstraints);
|
31 | /**
|
32 | * For floating point numbers between 0.0 (included) and 1.0 (excluded) - accuracy of `1 / 2**24`
|
33 | * @remarks Since 0.0.6
|
34 | * @public
|
35 | */
|
36 | declare function float(): Arbitrary<number>;
|
37 | /**
|
38 | * For floating point numbers between 0.0 (included) and max (excluded) - accuracy of `max / 2**24`
|
39 | *
|
40 | * @param max - Upper bound of the generated floating point
|
41 | *
|
42 | * @deprecated
|
43 | * Superceded by `fc.float({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 | */
|
49 | declare function float(max: number): Arbitrary<number>;
|
50 | /**
|
51 | * For floating point numbers between min (included) and max (excluded) - accuracy of `(max - min) / 2**24`
|
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.float({min, max})` instead.
|
57 | * @remarks Since 1.0.0
|
58 | * @public
|
59 | */
|
60 | declare function float(min: number, max: number): Arbitrary<number>;
|
61 | /**
|
62 | * For floating point numbers in range defined by constraints - accuracy of `(max - min) / 2**24`
|
63 | *
|
64 | * @param constraints - Constraints to apply when building instances
|
65 | *
|
66 | * @remarks Since 2.6.0
|
67 | * @public
|
68 | */
|
69 | declare function float(constraints: FloatConstraints): Arbitrary<number>;
|
70 | export { float };
|