summaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/example.ft29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/examples/example.ft b/src/examples/example.ft
index 3d6f5f2..1d41963 100644
--- a/src/examples/example.ft
+++ b/src/examples/example.ft
@@ -1,21 +1,18 @@
program example
-int::a
-int::b
-int::c
-a=2+3
-b=3
-c=a**b
-print*,c
-
+real::a
+real::root
+a=25
+root=sqrt(a)
+print*,"The square root of ",a," is ",root
end program example
-
-function int power(int value,int power)
-int::i
-int::final
-final=1
-do i=0,power-1
-final=final*value
+!Function to calculate the square root of a value
+function real sqrt(real value)
+real::result
+result=1
+int::count
+do count=0,10
+result =(result+value/result)/2
end do
-return final
+return result
end \ No newline at end of file