Show coordinates in operation bar
[oscopy.git] / test / arith.py
blobb9e0624779df926be7620d5612411870e1b6cd44
1 import numpy
2 from oscopy import Signal
4 a = Signal('v1', 'V')
5 a.data = numpy.arange(10, dtype='float')
7 b = Signal('v2', 'V')
8 b.data = numpy.arange(10, 20)
10 # arithmetics
11 print a
12 print b
13 print a + b
14 print a - b
16 a += b
17 print a
18 a -= b
19 print a
21 print a * b
22 a *= b
23 print a
25 a /= b
26 print a
27 print b / a
29 a -= 100 * b
30 print a
31 print -a
32 a += b * 100
33 print a + b * b - 12
35 # iteration
36 print tuple(a)