FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/array_size_02.py at main · srasgh/lpython · GitHub
srasgh
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
integration_tests
/
array_size_02.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (79 loc) · 1.89 KB
Breadcrumbs
lpython
/
integration_tests
/
array_size_02.py
Copy path
File metadata and controls
90 lines (79 loc) · 1.89 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from
lpython
import
i32
,
f64
,
c32
,
c64
,
u32
,
u64
from
numpy
import
empty
,
size
,
int32
,
uint32
,
uint64
,
float64
,
complex64
,
complex128
def
main0
():
x
:
i32
[
4
,
5
,
2
]
=
empty
([
4
,
5
,
2
],
dtype
=
int32
)
y
:
f64
[
24
,
100
,
2
,
5
]
=
empty
([
24
,
100
,
2
,
5
],
dtype
=
float64
)
z
:
i32
w
:
i32
z
=
2
w
=
3
print
(
size
(
x
))
print
(
size
(
x
,
0
))
print
(
size
(
x
,
1
))
print
(
size
(
x
,
2
))
print
(
size
(
y
))
print
(
size
(
y
,
0
))
print
(
size
(
y
,
1
))
print
(
size
(
y
,
z
))
print
(
size
(
y
,
w
))
assert
size
(
x
)
==
40
assert
size
(
x
,
0
)
==
4
assert
size
(
x
,
1
)
==
5
assert
size
(
x
,
2
)
==
2
assert
size
(
y
)
==
24000
assert
size
(
y
,
0
)
==
24
assert
size
(
y
,
1
)
==
100
assert
size
(
y
,
z
)
==
2
assert
size
(
y
,
w
)
==
5
def
main1
():
a
:
c32
[
12
]
=
empty
([
12
],
dtype
=
complex64
)
b
:
c64
[
15
,
15
,
10
]
=
empty
([
15
,
15
,
10
],
dtype
=
complex128
)
c
:
i32
d
:
i32
c
=
1
d
=
2
print
(
size
(
a
))
print
(
size
(
a
,
0
))
print
(
size
(
b
))
print
(
size
(
b
,
0
))
print
(
size
(
b
,
c
))
print
(
size
(
b
,
d
))
assert
size
(
a
)
==
12
assert
size
(
a
,
0
)
==
12
assert
size
(
b
)
==
2250
assert
size
(
b
,
0
)
==
15
assert
size
(
b
,
c
)
==
15
assert
size
(
b
,
d
)
==
10
def
main2
():
a
:
i32
[
2
,
3
]
=
empty
([
2
,
3
],
dtype
=
int32
)
print
(
size
(
a
))
print
(
size
(
a
,
0
))
print
(
size
(
a
,
1
))
assert
size
(
a
)
==
2
*
3
assert
size
(
a
,
0
)
==
2
assert
size
(
a
,
1
)
==
3
def
main3
():
a
:
u32
[
2
,
3
,
4
]
=
empty
([
2
,
3
,
4
],
dtype
=
uint32
)
b
:
u64
[
10
,
5
]
=
empty
([
10
,
5
],
dtype
=
uint64
)
c
:
i32
d
:
i32
c
=
1
d
=
2
print
(
size
(
a
))
print
(
size
(
a
,
0
))
print
(
size
(
a
,
c
))
print
(
size
(
a
,
d
))
print
(
size
(
b
))
print
(
size
(
b
,
0
))
print
(
size
(
b
,
c
))
assert
size
(
a
)
==
2
*
3
*
4
assert
size
(
a
,
0
)
==
2
assert
size
(
a
,
c
)
==
3
assert
size
(
a
,
d
)
==
4
assert
size
(
b
)
==
50
assert
size
(
b
,
0
)
==
10
assert
size
(
b
,
c
)
==
5
main0
()
main1
()
main2
()
main3
()
Back
|
FazBrowse Home
|
New Git URL