We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13be384 commit 55aeeedCopy full SHA for 55aeeed
src/runtime/lpython_builtin.py
@@ -64,11 +64,19 @@ def abs(b: bool) -> i32:
64
65
@overload
66
def abs(c: c32) -> f32:
67
- pass
+ a: f32
68
+ b: f32
69
+ a = c.real
70
+ b = _lfortran_caimag(c)
71
+ return (a**2 + b**2)**(1/2)
72
73
74
def abs(c: c64) -> f64:
75
+ a: f64
76
+ b: f64
77
78
+ b = _lfortran_zaimag(c)
79
80
81
82
def str(x: i32) -> str:
0 commit comments