Sqr() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns the square root of a number. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Sqr( num_expr )

num_expr is a positive numeric expression.

Return Value

Float

Description

The Sqr() function returns the square root of the numeric expression specified by num_expr. Since the square root operation is undefined for negative real numbers, num_expr should represent a value greater than or equal to zero.

Taking the square root of a number is equivalent to raising that number to the power 0.5. Accordingly, the expression Sqr(n) is equivalent to the expression n ^ 0.5; the Sqr() function, however, provides the fastest calculation of square roots.

Example

Dim n As Float
n = Sqr(25)

See Also:

Cos() function, Sin() function, Tan() function