Skip to content

Commit f2bd0bc

Browse files
certikSmit-create
authored andcommitted
Implement _imag using bind(c)
1 parent 4003bd0 commit f2bd0bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/runtime/lpython_builtin.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,19 @@ def lbound(x: i32[:], dim: i32) -> i32:
289289
def ubound(x: i32[:], dim: i32) -> i32:
290290
pass
291291

292+
@ccall
293+
def _lfortran_caimag(x: c32) -> f32:
294+
pass
295+
296+
@ccall
297+
def _lfortran_zaimag(x: c64) -> f64:
298+
pass
292299

300+
# TODO: rename to _lpython_imag()
293301
@overload
294302
def _imag(x: c64) -> f64:
295-
pass
303+
return _lfortran_zaimag(x)
296304

297305
@overload
298306
def _imag(x: c32) -> f32:
299-
pass
307+
return _lfortran_caimag(x)

0 commit comments

Comments
 (0)