User Tools

Site Tools

한국어

cubloc:sqr:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cubloc:sqr:index [2026/02/16 05:48] – created - external edit 127.0.0.1cubloc:sqr:index [2026/02/20 15:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Sqr ====== ====== Sqr ======
-Returns the square root of a value. 
  
 +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
 <code xbasic> <code xbasic>
-A=Sqr B   Return the square root of B+Dim A As Single 
 +Dim B As Single 
 +B = 25.0 
 +A = Sqr(B)      Returns 5.0
 </code> </code>
 +
 +==== 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)''
  
 [[cubloc:index#system_library:|Go CUBLOC home]] [[cubloc:index#system_library:|Go CUBLOC home]]
cubloc/sqr/index.1771220939.txt.gz · Last modified: by 127.0.0.1