sqrt
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Computes the square root of the input data.
Prototype
1 2 | template <typename T> __aicore__ inline T sqrt(const T src) |
Parameters
Parameter |
Description |
|---|---|
T |
Data type of the input data src. Currently, the supported data types are float and int64_t. |
Parameter |
Input/Output |
Description |
|---|---|---|
src |
Input |
Source operand. |
Restrictions
The input must be a non-negative number. If the input value is a negative number, the return value is meaningless.
Returns
Square root of the input data.
For data of the int64_t type, the calculation result is truncated to an integer.
Examples
1 2 3 4 | int64_t src = 4; int64_t result = AscendC::Std::sqrt(src); // result: 2 |
Parent topic: Mathematical Functions