Method: Sqr for VBS
- 已更新2024-09-12
- 閱讀時間為 1 分鐘
Methods > Method: Sqr for VBS
Method: Sqr for VBS
Calculates the square root of a number.
vSqr = Object.Sqr(number)
| Object | VBS Object with this method. You do not need to specify this object. |
| number | Variant Specifies a numeric expression that is greater than or equal to 0. |
| vSqr | Variant Receives the square root. |
The following example calculates the square root of various numbers:
Dim MyVar MyVar = Sqr(121) Call MsgBox(MyVar) ' Returns 11 MyVar = Sqr(0) Call MsgBox(MyVar) ' Returns 0