mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Document integer literal parsing (#5462)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
parent
d04cc61eee
commit
57f7c167d8
@ -11,7 +11,12 @@ use crate::foundations::{
|
|||||||
///
|
///
|
||||||
/// The number can be negative, zero, or positive. As Typst uses 64 bits to
|
/// The number can be negative, zero, or positive. As Typst uses 64 bits to
|
||||||
/// store integers, integers cannot be smaller than `{-9223372036854775808}` or
|
/// store integers, integers cannot be smaller than `{-9223372036854775808}` or
|
||||||
/// larger than `{9223372036854775807}`.
|
/// larger than `{9223372036854775807}`. Integer literals are always positive,
|
||||||
|
/// so a negative integer such as `{-1}` is semantically the negation `-` of the
|
||||||
|
/// positive literal `1`. A positive integer greater than the maximum value and
|
||||||
|
/// a negative integer less than or equal to the minimum value cannot be
|
||||||
|
/// represented as an integer literal, and are instead parsed as a `{float}`.
|
||||||
|
/// The minimum integer value can still be obtained through integer arithmetic.
|
||||||
///
|
///
|
||||||
/// The number can also be specified as hexadecimal, octal, or binary by
|
/// The number can also be specified as hexadecimal, octal, or binary by
|
||||||
/// starting it with a zero followed by either `x`, `o`, or `b`.
|
/// starting it with a zero followed by either `x`, `o`, or `b`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user