FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/array_03.py at main · tanay-man/lpython · GitHub
tanay-man
/
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_03.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (18 loc) · 458 Bytes
Breadcrumbs
lpython
/
integration_tests
/
array_03.py
Copy path
File metadata and controls
20 lines (18 loc) · 458 Bytes
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
from
lpython
import
Allocatable
,
f64
,
i32
from
numpy
import
empty
,
float64
,
int32
def
f
():
n
:
i32
=
5
a
:
Allocatable
[
f64
[:]]
=
empty
((
n
,),
dtype
=
float64
)
i
:
i32
for
i
in
range
(
n
):
a
[
i
]
=
f64
(
i
+
1
)
for
i
in
range
(
n
):
assert
abs
(
a
[
i
]
-
f64
(
i
+
1
))
<
1e-12
b
:
Allocatable
[
i32
[:]]
n
=
10
b
=
empty
((
n
,),
dtype
=
int32
)
for
i
in
range
(
n
):
b
[
i
]
=
i
+
1
for
i
in
range
(
n
):
assert
b
[
i
]
==
i
+
1
f
()
Back
|
FazBrowse Home
|
New Git URL