From: Tim Vaughan Date: Sun, 13 Nov 2016 10:45:11 +0000 (+1300) Subject: Added some more float words. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=commitdiff_plain;h=dee0ca5343f31d2fd0480f515a07665c1a6c8951 Added some more float words. --- diff --git a/src/float.4th b/src/float.4th index 74a4f08..bdedd92 100644 --- a/src/float.4th +++ b/src/float.4th @@ -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 = 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 diff --git a/src/scheme.4th b/src/scheme.4th index 165d88f..c1d42e8 100644 --- a/src/scheme.4th +++ b/src/scheme.4th @@ -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