Sqrt
Result# = Sqrt(InputValue#)
 
Parameters:

    InputValue# = The Value you wish to find the square root of
Returns:

    Result# = The Square root of Input Value
 

      Sqrt calculates the square root of a positive number. The square root of a number, is a value than when multiply by it'self equals the original value.



FACTS:


      * Only positive numbers

      * Hint: Sqrt is often used to calculate the distance between two objects ( Pythagoras theorem). PlayBASIC has a built in command for this purpose called GetDistance2D, which is not only simpler, but faster.




Mini Tutorial:



  
; Calculate the square root of 100
  result#=Sqrt(100)
  
; print the Result (the square root of 100)
  Print Result#
  
; print the Square of the Result (result times by itself)
  Print Result#*result#
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  10.0
  100.0
  

 
Related Info: Abs | Exp | GetAngle2D | GetDistance2D | GetDistance3D | Sin :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com