In Visual Basic, the Sqr function is used to find the square root of a function. The result of a Sqr function is of data type double. The syntax is:
where number is a positive number or a variable ,constant, or even another function representing a positive number.


The SQR function computes the square root of its argument. This is -- as usual in computing -- the nonnegative branch. So for any x>=0,

(to use BASIC syntax).

If x<0, SQR(x) will cause a run time error.


Perversely, Pascal defines sqr(x) to compute the square of x. So

for any x.

This gave many computer children of the 80s great pain when trying to continue to program in both BASIC and Pascal.

Log in or register to write something here or to contact authors.