require "cmath" CMath.sqrt(-9) #=> 0+3.0i CMath.acos(0+3.0i) #=> (1.5707963267948966-1.8184464592320668i) #etc