WPILibC++ 2023.4.3-108-ge5452e3
inv_sqrt.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  internal
 

Functions

template<typename T >
constexpr T internal::inv_sqrt_recur (const T x, const T xn, const int count) noexcept
 
template<typename T >
constexpr T internal::inv_sqrt_check (const T x) noexcept
 
template<typename T >
constexpr return_t< T > inv_sqrt (const T x) noexcept
 Compile-time inverse-square-root function. More...
 

Function Documentation

◆ inv_sqrt()

template<typename T >
constexpr return_t< T > inv_sqrt ( const T  x)
constexprnoexcept

Compile-time inverse-square-root function.

Parameters
xa real-valued input.
Returns
Computes \( 1 / \sqrt{x} \) using a Newton-Raphson approach.