lfortran icon indicating copy to clipboard operation
lfortran copied to clipboard

Math: Implement `sqrt`

Open certik opened this issue 3 years ago • 1 comments

Original issue: https://gitlab.com/lfortran/lfortran/-/issues/468

Needed for https://gitlab.com/lfortran/lfortran/-/issues/401.

Definition

As per J3/18-007r1 (the F2018 Interpretation Document): image

Example

Simple sample:

program intrinsics_08
real :: x

x = sqrt(0.76159416)
print *, x

end

Standard

Note that the relevant standard can be found here: 18-007r1.pdf

certik avatar Aug 15 '22 09:08 certik

I tested this a little, this can be considered done, right @certik ?

konradha avatar Aug 24 '22 14:08 konradha

I believe this is resolved already.

HarshitaKalani avatar Jul 03 '23 17:07 HarshitaKalani

Yes, sqrt works. Although it should be ported to use IntrinsicFunction.

certik avatar Jul 03 '23 20:07 certik