sqrt(@number) [ISO]

This arithmetic predicate calculates the square root of its argument.

see also: arithmetic in Prolog is/2

Examples
X is sqrt(16). succeeds, X is 4
X is sqrt(3). succeeds, X is 1.732051

 

Exceptions
the value of it's argument is smaller than 0 an evaluation_error(negative, A) exception is thrown
The floating point argument or result exceeds the floating point range an evaluation_error(float_overflow) exception is thrown
The integer argument result exceeds the integer range an evaluation_error(int_overflow) exception is thrown

 

 

info@trinc-prolog.com