This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| cubloc:sqr:index [2026/02/16 05:48] – created - external edit 127.0.0.1 | cubloc: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, | ||
| + | |||
| + | For the best precision, use the '' | ||
| + | |||
| + | Example | ||
| <code xbasic> | <code xbasic> | ||
| - | A=Sqr B | + | Dim A As Single |
| + | Dim B As Single | ||
| + | B = 25.0 | ||
| + | A = Sqr(B) | ||
| </ | </ | ||
| + | |||
| + | ==== 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)$: | ||
| + | '' | ||
| [[cubloc: | [[cubloc: | ||