Add sqrt
This commit is contained in:
parent
a9d5a4d03b
commit
70a968d7a0
@ -73,6 +73,11 @@ Returns the larger of `a` and `b`.
|
||||
|
||||
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`
|
||||
*Note: (only on floating-point numbers)*
|
||||
|
||||
@ -113,6 +118,11 @@ Calculates arccosine 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`
|
||||
*Note: (only on floating-point numbers)*
|
||||
|
||||
|
@ -130,6 +130,12 @@ pub fn get_intrinsic_assoc_functions(ty: &TypeKind) -> Vec<FunctionDefinition> {
|
||||
});
|
||||
}
|
||||
if ty.category() == TypeCategory::Real {
|
||||
intrinsics.push(simple_intrinsic(
|
||||
"sqrt",
|
||||
vec!["self"],
|
||||
ty.clone(),
|
||||
LLVMIntrinsicKind::Sqrt(ty.clone()),
|
||||
));
|
||||
intrinsics.push(simple_intrinsic(
|
||||
"sin",
|
||||
vec!["self"],
|
||||
|
Loading…
Reference in New Issue
Block a user