Skip to main content

Module sqrt

Module sqrt 

Source
Expand description

Square root of f32 for no_std, powered by embedded-f32-sqrt.

This module calls embedded_f32_sqrt::sqrt rather than relying on micromath or floating-point methods that require std. It uses IEEE 754 bit manipulation and Newton-Raphson iterations and is suitable for embedded targets with or without an FPU.

§Behavior

InputResult
>= 0.0Ok(square_root)
-0.0Ok(-0.0)
Negative valueErr(NegativeInput)
NaNOk(NaN)
+InfinityOk(+Infinity)

Structs§

NegativeInput
Error returned for a negative input.

Functions§

sqrt
Computes the square root of x.