summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalo <57839069+MDLC01@users.noreply.github.com>2025-06-02 14:04:49 +0100
committerGitHub <noreply@github.com>2025-06-02 13:04:49 +0000
commit4329a15a1cb44a849c9b6a8cd932867b4aa53ed0 (patch)
treef1eae2eb0f8be2e73d957c94d9fbf06b85c1db96
parent83e249dd334442b09bbeebcc70cae83950c31311 (diff)
Improve `calc.round` documentation (#6345)
-rw-r--r--crates/typst-library/src/foundations/calc.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/typst-library/src/foundations/calc.rs b/crates/typst-library/src/foundations/calc.rs
index a8e0eaeb..7f481a23 100644
--- a/crates/typst-library/src/foundations/calc.rs
+++ b/crates/typst-library/src/foundations/calc.rs
@@ -708,12 +708,13 @@ pub fn fract(
}
}
-/// Rounds a number to the nearest integer away from zero.
+/// Rounds a number to the nearest integer.
///
-/// Optionally, a number of decimal places can be specified.
+/// Half-integers are rounded away from zero.
///
-/// If the number of digits is negative, its absolute value will indicate the
-/// amount of significant integer digits to remove before the decimal point.
+/// Optionally, a number of decimal places can be specified. If negative, its
+/// absolute value will indicate the amount of significant integer digits to
+/// remove before the decimal point.
///
/// Note that this function will return the same type as the operand. That is,
/// applying `round` to a [`float`] will return a `float`, and to a [`decimal`],