Added some more float words.
authorTim Vaughan <tgvaughan@gmail.com>
Sun, 13 Nov 2016 10:45:11 +0000 (23:45 +1300)
committerTim Vaughan <tgvaughan@gmail.com>
Sun, 13 Nov 2016 10:45:11 +0000 (23:45 +1300)
src/float.4th
src/scheme.4th

index 74a4f08..bdedd92 100644 (file)
@@ -29,3 +29,53 @@ CODE f/
     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 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
index 165d88f..c1d42e8 100644 (file)
@@ -24,6 +24,7 @@ variable nexttype
     does> @ ;
 
 make-type fixnum-type
+make-type flonum-type
 make-type boolean-type
 make-type character-type
 make-type string-type