9.133 __sqrt intrinsic

This intrinsic inserts a VFP VSQRT instruction into the instruction stream generated by the compiler. It enables you to obtain the square root of a double-precision floating-point value from within your C or C++ code.

Note

The __sqrt intrinsic is an analog of the standard C library function sqrt(). It differs from the standard library function in that a call to __sqrt is guaranteed to be compiled into a single, inline, machine instruction on an ARM architecture-based processor equipped with a VFP coprocessor.

Syntax

double __sqrt(double val)
Where:
val
is a double-precision floating-point value.

Return value

The __sqrt intrinsic returns the square root of val as a double.

Errors

The compiler does not recognize the __sqrt intrinsic when compiling for a target that is not equipped with a VFP coprocessor. The compiler generates either a warning or an error in this case, depending on the source language:
  • In C code: Warning: #223-D: function "__sqrt" declared implicitly.
  • In C++ code: Error: #20: identifier "__sqrt" is undefined.
Related reference
9.134 __sqrtf intrinsic
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.