FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/expr_04.py at main · sak-codes/lpython · GitHub
sak-codes
/
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
/
expr_04.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
62 lines (53 loc) · 1.06 KB
Breadcrumbs
lpython
/
integration_tests
/
expr_04.py
Copy path
File metadata and controls
62 lines (53 loc) · 1.06 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
from
ltypes
import
i32
,
f32
,
f64
,
i64
def
main0
():
i
:
i32
sum
:
i32
sum
=
0
for
i
in
range
(
0
,
10
):
if
i
==
0
:
continue
sum
+=
i
if
i
>
5
:
break
assert
sum
==
21
def
test_issue_255
():
i
:
f64
i
=
300.27
eps
:
f64
eps
=
1e-12
assert
abs
(
i
//
1.0
-
300.0
)
<
eps
def
test_floor_div
():
a
:
i32
b
:
i32
a
=
5
b
=
2
assert
a
//
b
==
2
a
=
-
5
assert
a
//
b
==
-
3
x
:
f32
eps
:
f64
eps
=
1e-12
x
=
f32
(
5.0
)
assert
f64
(
abs
(
x
//
f32
(
2
)
-
f32
(
2
)))
<
eps
assert
f64
(
abs
(
x
//
f32
(
2.0
)
-
f32
(
2.0
)))
<
eps
x
=
-
f32
(
5.0
)
assert
f64
(
abs
(
x
//
f32
(
2
)
+
f32
(
3.0
)))
<
eps
assert
f64
(
abs
(
x
//
f32
(
2.0
)
+
f32
(
3.0
)))
<
eps
def
test_floor_div_9_digits
():
# reference: issue 768
x4
:
i32
y4
:
i32
y4
=
10
x4
=
123456789
assert
x4
//
y4
==
12345678
x8
:
i64
y8
:
i64
y8
=
i64
(
10
)
x8
=
i64
(
123456789
)
assert
x8
//
y8
==
i64
(
12345678
)
def
check
():
test_issue_255
()
main0
()
test_floor_div
()
test_floor_div_9_digits
()
check
()
Back
|
FazBrowse Home
|
New Git URL