repo.or.cz
/
oscopy.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Show coordinates in operation bar
[oscopy.git]
/
test
/
arith.py
blob
b9e0624779df926be7620d5612411870e1b6cd44
1
import
numpy
2
from
oscopy
import
Signal
3
4
a
=
Signal
(
'v1'
,
'V'
)
5
a
.
data
=
numpy
.
arange
(
10
,
dtype
=
'float'
)
6
7
b
=
Signal
(
'v2'
,
'V'
)
8
b
.
data
=
numpy
.
arange
(
10
,
20
)
9
10
# arithmetics
11
print
a
12
print
b
13
print
a
+
b
14
print
a
-
b
15
16
a
+=
b
17
print
a
18
a
-=
b
19
print
a
20
21
print
a
*
b
22
a
*=
b
23
print
a
24
25
a
/=
b
26
print
a
27
print
b
/
a
28
29
a
-=
100
*
b
30
print
a
31
print
-
a
32
a
+=
b
*
100
33
print
a
+
b
*
b
-
12
34
35
# iteration
36
print
tuple
(
a
)
37