{{htmlmetatags>metatag-robots=() metatag-title=(SQR | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for SQR) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(SQR | ugBASIC User Manual) metatag-og:description=(Manual page for SQR) }} ====== ugBASIC User Manual ====== ===== SQR ✓ ===== ===== SYNTAX ===== = SQR(expression) ==== PURPOSE ==== The ''SQR'' command (short for "square root") is a mathematical function that is used to calculate the square root of a number. In other words, given a number ''x'', the command ''SQR(x)'' returns the number that, when multiplied by itself, gives the result ''x''. The ''SQR'' command has many applications in programming: it is used in any calculation that requires the calculation of the square root, such as in the Pythagorean theorem. The square root is present in many physics formulas, such as in the calculation of velocity. It is used also to calculate the lengths of segments or areas of geometric figures, and in many statistical calculations, such as in the calculation of standard deviation. The square root of a negative number is not defined in real numbers. If you try to calculate the square root of a negative number, the result is indefinite. Moreover, the function is defined in the integer numbers domain. ==== EXAMPLE ==== PRINT SNG(81) See also the following example files: * ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/maths_sqr_01.bas|maths_sqr_01.bas]]'' ==== AVAILABLE ON ==== ==== ANY PROBLEM? ==== If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON SQR|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]