Sqr Function

Category: GUI » Visual Basic 6 » Function

Description: Returns a Double value specifying the square root of a number Syntax: Sqr(number)

ParametersDescription
number Required. A numeric expression

Return Data Type: Double Usage / Example Code:

StatementResult / ValueRemark / Note
sqr(1) 1  
sqr(1.5) 1.22474487139159  
sqr(3) 1.73205080756888  
sqr(9) 3  
sqr(-1) Error Run-time error '5': Invalid procedure call or argument
sqr(0) 0  
sqr(unknown) 0 Uninitialized variable
sqr(null) Error Run-time error '94': Invalid use of Null
sqr("1.5") 1.22474487139159  
sqr("string") Error Run-time error '13': Type mismatch
sqr(true) Error Run-time error '5': Invalid procedure call or argument
sqr(false) 0  
sqr() Compile error: Argument not optional  

Related Articles:

Tags: Math Functions, vb6