-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sole purpose is to increase code coverage here
- Loading branch information
1 parent
f166899
commit 17c0799
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
program test | ||
use iso_fortran_env,only:i1 => int8,i2 => int16,i4 => int32,i8 => int64, & | ||
r4 => real32,r8 => real64,r16 => real128 | ||
use FEQParse | ||
|
||
implicit none | ||
|
||
write(*,'(A,I20)') "test ",testing() | ||
|
||
contains | ||
|
||
integer function testing() result(r) | ||
!private | ||
type(EquationParser) :: f | ||
real(r4) :: feval | ||
|
||
call AddFunction("myfunc",myfunc32) | ||
|
||
f = EquationParser("MYFUNC(x)",["x"]) | ||
|
||
feval = f%evaluate([1.0_r4]) | ||
if((abs(feval-0.5_r4)) <= epsilon(1.0_r4)) then | ||
r = 0 | ||
else | ||
r = 1 | ||
endif | ||
endfunction | ||
|
||
pure real(r4) function myfunc32(x) | ||
real(r4),intent(in) :: x | ||
myfunc32 = x/2.0_r4 | ||
endfunction | ||
endprogram |