@@ -90,11 +90,13 @@ export class NumberModule {
90
90
91
91
/**
92
92
* Returns a single random floating-point number for a given precision or range and precision.
93
+ * The lower bound is inclusive, the upper bound is exclusive, unless precision is passed.
93
94
*
94
95
* @param options Upper bound or options object. Defaults to `{}`.
95
96
* @param options.min Lower bound for generated number. Defaults to `0.0`.
96
97
* @param options.max Upper bound for generated number. Defaults to `1.0`.
97
98
* @param options.precision Precision of the generated number, for example `0.01` will round to 2 decimal points.
99
+ * If precision is passed, the upper bound is inclusive.
98
100
*
99
101
* @example
100
102
* faker.number.float() // 0.5688541042618454
@@ -165,6 +167,7 @@ export class NumberModule {
165
167
166
168
/**
167
169
* Returns a [binary](https://en.wikipedia.org/wiki/Binary_number) number.
170
+ * The bounds are inclusive.
168
171
*
169
172
* @param options Maximum value or options object. Defaults to `{}`.
170
173
* @param options.min Lower bound for generated number. Defaults to `0`.
@@ -213,6 +216,7 @@ export class NumberModule {
213
216
214
217
/**
215
218
* Returns an [octal](https://en.wikipedia.org/wiki/Octal) number.
219
+ * The bounds are inclusive.
216
220
*
217
221
* @param options Maximum value or options object. Defaults to `{}`.
218
222
* @param options.min Lower bound for generated number. Defaults to `0`.
@@ -261,11 +265,14 @@ export class NumberModule {
261
265
262
266
/**
263
267
* Returns a lowercase [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) number.
268
+ * The bounds are inclusive.
264
269
*
265
270
* @param options Maximum value or options object. Defaults to `{}`.
266
271
* @param options.min Lower bound for generated number. Defaults to `0`.
267
272
* @param options.max Upper bound for generated number. Defaults to `15`.
268
273
*
274
+ * @throws When options define `max < min`.
275
+ *
269
276
* @example
270
277
* faker.number.hex() // 'b'
271
278
* faker.number.hex(255) // '9d'
@@ -305,6 +312,7 @@ export class NumberModule {
305
312
306
313
/**
307
314
* Returns a [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type) number.
315
+ * The bounds are inclusive.
308
316
*
309
317
* @param options Maximum value or options object. Defaults to `{}`.
310
318
* @param options.min Lower bound for generated bigint. Defaults to `0n`.
0 commit comments