This commit is contained in:
Sofia 2025-08-04 19:48:14 +03:00
parent a9d5a4d03b
commit 70a968d7a0
2 changed files with 16 additions and 0 deletions

View File

@ -73,6 +73,11 @@ Returns the larger of `a` and `b`.
Returns the absolute value of `value`. Returns the absolute value of `value`.
#### `<T>::sqrt(value: T) -> T`
*Note: (only on floating-point numbers)*
Calculates the square-root of `value`
#### `<T>::pow(value: T, exponent: T) -> T` #### `<T>::pow(value: T, exponent: T) -> T`
*Note: (only on floating-point numbers)* *Note: (only on floating-point numbers)*
@ -113,6 +118,11 @@ Calculates arccosine of `value`
Calculates arctangent of `value` Calculates arctangent of `value`
#### `<T>::atan2(value: T) -> T`
*Note: (only on floating-point numbers)*
Calculates 2-argument arctangent of `value`
#### `<T>::sinh(value: T) -> T` #### `<T>::sinh(value: T) -> T`
*Note: (only on floating-point numbers)* *Note: (only on floating-point numbers)*

View File

@ -130,6 +130,12 @@ pub fn get_intrinsic_assoc_functions(ty: &TypeKind) -> Vec<FunctionDefinition> {
}); });
} }
if ty.category() == TypeCategory::Real { if ty.category() == TypeCategory::Real {
intrinsics.push(simple_intrinsic(
"sqrt",
vec!["self"],
ty.clone(),
LLVMIntrinsicKind::Sqrt(ty.clone()),
));
intrinsics.push(simple_intrinsic( intrinsics.push(simple_intrinsic(
"sin", "sin",
vec!["self"], vec!["self"],