Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -6,6 +6,9 @@ i = Complex::I # 2. use Complex::I
b = 3.14159 + 1.25 * i
c = '1/2+3/4i'.to_c # 3. Use the .to_c method from String, result ((1/2)+(3/4)*i)
#Ruby 2.1 introduced a suffix to create a complex:
c = 1.0/2+3/4i # (0.5-(3/4)*i)
# Operations:
puts a + b # addition
puts a * b # multiplication