mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Fix calc doc comments
This commit is contained in:
parent
e1f2acff62
commit
60ef41cef4
@ -38,7 +38,7 @@ pub fn calc() -> Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Absolute
|
/// # Absolute
|
||||||
/// The absolute value of a numeric value.
|
/// Calculate the absolute value of a numeric value.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -104,7 +104,7 @@ pub fn pow(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Square Root
|
/// # Square Root
|
||||||
/// The square root of a number.
|
/// Calculate the square root of a number.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -128,8 +128,10 @@ pub fn sqrt(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Sine
|
/// # Sine
|
||||||
/// Calculate the sine of an angle. When called with an integer or a number,
|
/// Calculate the sine of an angle.
|
||||||
/// they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as
|
||||||
|
/// radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -155,8 +157,10 @@ pub fn sin(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Cosine
|
/// # Cosine
|
||||||
/// Calculate the cosine of an angle. When called with an integer or a number,
|
/// Calculate the cosine of an angle.
|
||||||
/// they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as
|
||||||
|
/// radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -182,8 +186,10 @@ pub fn cos(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Tangent
|
/// # Tangent
|
||||||
/// Calculate the tangent of an angle. When called with an integer or a number,
|
/// Calculate the tangent of an angle.
|
||||||
/// they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as
|
||||||
|
/// radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -279,8 +285,9 @@ pub fn atan(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Hyperbolic sine
|
/// # Hyperbolic sine
|
||||||
/// Calculate the hyperbolic sine of an angle. When called with an integer or
|
/// Calculate the hyperbolic sine of an angle.
|
||||||
/// a number, they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -305,8 +312,9 @@ pub fn sinh(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Hyperbolic cosine
|
/// # Hyperbolic cosine
|
||||||
/// Calculate the hyperbolic cosine of an angle. When called with an integer or
|
/// Calculate the hyperbolic cosine of an angle.
|
||||||
/// a number, they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -331,8 +339,9 @@ pub fn cosh(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Hyperbolic tangent
|
/// # Hyperbolic tangent
|
||||||
/// Calculate the hyperbolic tangent of an angle. When called with an integer or
|
/// Calculate the hyperbolic tangent of an angle.
|
||||||
/// a number, they will be interpreted as radians.
|
///
|
||||||
|
/// When called with an integer or a float, they will be interpreted as radians.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -358,6 +367,7 @@ pub fn tanh(args: &mut Args) -> SourceResult<Value> {
|
|||||||
|
|
||||||
/// # Logarithm
|
/// # Logarithm
|
||||||
/// Calculate the logarithm of a number.
|
/// Calculate the logarithm of a number.
|
||||||
|
///
|
||||||
/// If the base is not specified, the logarithm is calculated in base 10.
|
/// If the base is not specified, the logarithm is calculated in base 10.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
@ -382,6 +392,7 @@ pub fn log(args: &mut Args) -> SourceResult<Value> {
|
|||||||
|
|
||||||
/// # Round down
|
/// # Round down
|
||||||
/// Round a number down to the nearest integer.
|
/// Round a number down to the nearest integer.
|
||||||
|
///
|
||||||
/// If the number is already an integer, it is returned unchanged.
|
/// If the number is already an integer, it is returned unchanged.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
@ -408,6 +419,7 @@ pub fn floor(args: &mut Args) -> SourceResult<Value> {
|
|||||||
|
|
||||||
/// # Round up
|
/// # Round up
|
||||||
/// Round a number up to the nearest integer.
|
/// Round a number up to the nearest integer.
|
||||||
|
///
|
||||||
/// If the number is already an integer, it is returned unchanged.
|
/// If the number is already an integer, it is returned unchanged.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
@ -434,6 +446,7 @@ pub fn ceil(args: &mut Args) -> SourceResult<Value> {
|
|||||||
|
|
||||||
/// # Round
|
/// # Round
|
||||||
/// Round a number to the nearest integer.
|
/// Round a number to the nearest integer.
|
||||||
|
///
|
||||||
/// Optionally, a number of decimal places can be specified.
|
/// Optionally, a number of decimal places can be specified.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
@ -496,7 +509,7 @@ pub fn clamp(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Minimum
|
/// # Minimum
|
||||||
/// The minimum of a sequence of values.
|
/// Determine the minimum of a sequence of values.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -519,7 +532,7 @@ pub fn min(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Maximum
|
/// # Maximum
|
||||||
/// The maximum of a sequence of values.
|
/// Determine the maximum of a sequence of values.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -563,7 +576,7 @@ fn minmax(args: &mut Args, goal: Ordering) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Even
|
/// # Even
|
||||||
/// Whether an integer is even.
|
/// Determine whether an integer is even.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -586,7 +599,7 @@ pub fn even(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Odd
|
/// # Odd
|
||||||
/// Whether an integer is odd.
|
/// Determine whether an integer is odd.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
@ -610,7 +623,7 @@ pub fn odd(args: &mut Args) -> SourceResult<Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// # Modulus
|
/// # Modulus
|
||||||
/// The modulus of two numbers.
|
/// Calculate the modulus of two numbers.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user