Skip to content

Commit 398751c

Browse files
docs: clarify that numeric formats bounds are inclusive
1 parent 6150ca2 commit 398751c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/docs/content/v4/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,17 +717,17 @@ Read the [template literal docs](/api#template-literals) for more info.
717717
718718
## Number formats
719719
720-
New numeric "formats" have been added for representing fixed-width integer and float types. These return a `ZodNumber` instance with proper minimum/maximum constraints already added.
720+
New numeric "formats" have been added for representing fixed-width integer and float types. These return a `ZodNumber` instance with proper inclusive minimum/maximum constraints already added.
721721
722722
```ts
723-
z.int(); // [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
723+
z.int(); // [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]
724724
z.float32(); // [-3.4028234663852886e38, 3.4028234663852886e38]
725725
z.float64(); // [-1.7976931348623157e308, 1.7976931348623157e308]
726726
z.int32(); // [-2147483648, 2147483647]
727727
z.uint32(); // [0, 4294967295]
728728
```
729729
730-
Similarly the following `bigint` numeric formats have also been added. These integer types exceed what can be safely represented by a `number` in JavaScript, so these return a `ZodBigInt` instance with the proper minimum/maximum constraints already added.
730+
Similarly the following `bigint` numeric formats have also been added. These integer types exceed what can be safely represented by a `number` in JavaScript, so these return a `ZodBigInt` instance with the proper inclusive minimum/maximum constraints already added.
731731
732732
```ts
733733
z.int64(); // [-9223372036854775808n, 9223372036854775807n]

0 commit comments

Comments
 (0)