File: testpow.rb

package info (click to toggle)
ruby-narray 0.6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: ansic: 4,498; ruby: 1,329; python: 91; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 347 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require "narray"

def test a
  puts 'a = '
  p  a
  puts 'a**[[-3],[0],[7]] = '
  p  a**[[-3],[0],[7]]
  puts 'a**[[-3.0],[0],[7.0]] = '
  p  a**[[-3.0],[0],[7.0]]
  puts 'a**(1+0.im) = '
  p  a**(1+0.im)
  puts 'a**1.0 = '
  p  a**1.0
  puts
end

test NArray.int(4).indgen!*2-2
test NArray.float(4).indgen!*2-2
test NArray.complex(4).indgen!*2-2