Added some more float words.
[scheme.forth.jl.git] / src / float.4th
index 95aaa3b..bdedd92 100644 (file)
@@ -30,15 +30,52 @@ CODE f/
     pushPS(reinterpret(Int64, a/b))
 END-CODE
 
-( addr len -- float )
-CODE float-parse
-    len = popPS()
-    addr = popPS()
-    val = parse(Float64, getString(addr, len))
-    pushPS(reinterpret(Int64, val))
-END-CODE
-
-( float -- )
-CODE float-print
-    print(reinterpret(Float64, popPS()))
-END-CODE
\ No newline at end of file
+CODE f^
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a^b))
+END-CODE
+
+CODE f>
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a>b))
+END-CODE
+
+CODE f<
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a<b))
+END-CODE
+
+CODE f=
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a=b))
+END-CODE
+
+CODE f<=
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a<=b))
+END-CODE
+
+CODE f>=
+    b = reinterpret(Float64, popPS())
+    a = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, a>=b))
+END-CODE
+
+CODE flog
+    b = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, log(a)))
+END-CODE
+
+CODE fexp
+    b = reinterpret(Float64, popPS())
+    pushPS(reinterpret(Int64, exp(a)))
+END-CODE
+
+CODE i->f
+    pushPS(reinterpret(Int64, Float64(popPS())))
+END-CODE