std-sqrt | ![]() |
Returns the square root of the number, such as the system function sqrt. But the return type maybe a integer number if argument is integer and the resulting square root may be exactly represented as integer. The AutoLISP sqrt always returns a real.
Integer type preservation is more costly than a simple real square root so better use it in output functions but not in fast inner loops.
If the argument is negative the corresponding AutoLISP error is thrown, such as:ERROR: function undefined for argument: -25.0
(std-sqrt 2.0) => 4.0 (std-sqrt 4) => 2 (std-sqrt 4.0) => 2.0 (std-sqrt 625) => 25
num: Any number, if integer or real.
A integer or real number.
None.
(std-require 'STDMATH)
Defined in STDMATH