Как вычислить корень из числа в c
Перейти к содержимому

Как вычислить корень из числа в c

  • автор:


sqrt, sqrtf, sqrtl

If no errors occur, square root of arg ( \( <\small \sqrt>\) √ arg ), is returned.

If a domain error occurs, an implementation-defined value is returned (NaN where supported).

If a range error occurs due to underflow, the correct result (after rounding) is returned.


[edit] Error handling

Errors are reported as specified in math_errhandling.

Domain error occurs if arg is less than zero.

If the implementation supports IEEE floating-point arithmetic (IEC 60559),

  • If the argument is less than -0, FE_INVALID is raised and NaN is returned.
  • If the argument is +∞ or ±0, it is returned, unmodified.
  • If the argument is NaN, NaN is returned

[edit] Notes

sqrt is required by the IEEE standard to be correctly rounded from the infinitely precise result. In particular, the exact result is produced if it can be represented in the floating-point type. The only other operations which require this are the arithmetic operators and the function fma . Other functions, including pow , are not so constrained.


Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *