Skip to main content

Function: nat()

Call Signature

nat(): Arbitrary<number>

Defined in: packages/fast-check/src/arbitrary/nat.ts:25

For positive integers between 0 (included) and 2147483647 (included)

Returns

Arbitrary<number>

Remarks

Since 0.0.1

Call Signature

nat(max): Arbitrary<number>

Defined in: packages/fast-check/src/arbitrary/nat.ts:35

For positive integers between 0 (included) and max (included)

Parameters

ParameterTypeDescription
maxnumberUpper bound for the generated integers

Returns

Arbitrary<number>

Remarks

You may prefer to use fc.nat({max}) instead.

Call Signature

nat(constraints): Arbitrary<number>

Defined in: packages/fast-check/src/arbitrary/nat.ts:44

For positive integers between 0 (included) and max (included)

Parameters

ParameterTypeDescription
constraintsNatConstraintsConstraints to apply when building instances

Returns

Arbitrary<number>

Remarks

Since 2.6.0

Call Signature

nat(arg?): Arbitrary<number>

Defined in: packages/fast-check/src/arbitrary/nat.ts:53

For positive integers between 0 (included) and max (included)

Parameters

ParameterTypeDescription
arg?number | NatConstraintsEither a maximum number or constraints to apply when building instances

Returns

Arbitrary<number>

Remarks

Since 2.6.0