NRAO Home > CASA > CASA Toolkit Reference Manual
quanta.sqrt - Function

1.5.1 square root of quantity


Description

sqrt gives square root of quantity with only even powered dimensions

Arguments





Inputs

v

dimensionless quantity

allowed:

any

Default:

variant

Returns
record

Example

 
 
"""  
#  
print "\t----\t sqrt Ex 1 \t----"  
print qa.sqrt(’2m2’)  
#{’value’: 1.4142135623730951, ’unit’: ’m’}  
try:  
  print qa.sqrt(’2s’)  
except Exception, e:  
  print "Caught an expected exception", e  
#Caught an expected exception UnitVal::UnitVal Illegal unit dimensions for root  
#  
"""  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search