User Tools

Site Tools

한국어

cubloc:sqr:index

This is an old revision of the document!


Sqr

The Sqr function returns the square root ($\sqrt{x}$) of a numeric value. It is essential for distance calculations, sensor data normalization, and power computations.

For the best precision, use the Single data type. Note: Input must be a non-negative number; negative values will cause a runtime error.

Example

Dim A As Single
Dim B As Single
B = 25.0
A = Sqr(B)      ' Returns 5.0

Explanation:

  • B: A non-negative number.
  • Sqr B: Calculates the square root.
  • A: Stores the result.

Usage Tip (Distance): To find the distance between two points $(x1, y1)$ and $(x2, y2)$: Distance = Sqr((x2-x1)^2 + (y2-y1)^2)

Go CUBLOC home

cubloc/sqr/index.1771564352.txt.gz · Last modified: by admin