Debian Codegraph @

mypyc/test-data/irbuild-math.test

raw
1 [case testMathLiteralsAreInlined]
2 import math
3 from math import pi, e, tau, inf, nan
4
5 def f1() -> float:
6 return pi
7
8 def f2() -> float:
9 return math.pi
10
11 def f3() -> float:
12 return math.e
13
14 def f4() -> float:
15 return math.e
16
17 def f5() -> float:
18 return math.tau
19
20 def f6() -> float:
21 return math.tau
22
23 def f7() -> float:
24 return math.inf
25 def f8() -> float:
26 return math.inf
27
28 def f9() -> float:
29 return math.nan
30
31 def f10() -> float:
32 return math.nan
33
34 [out]
35 def f1():
36 L0:
37 return 3.141592653589793
38 def f2():
39 L0:
40 return 3.141592653589793
41 def f3():
42 L0:
43 return 2.718281828459045
44 def f4():
45 L0:
46 return 2.718281828459045
47 def f5():
48 L0:
49 return 6.283185307179586
50 def f6():
51 L0:
52 return 6.283185307179586
53 def f7():
54 L0:
55 return inf
56 def f8():
57 L0:
58 return inf
59 def f9():
60 L0:
61 return nan
62 def f10():
63 L0:
64 return nan