X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=blobdiff_plain;f=src%2Fscheme-primitives.4th;h=8dad18e02a36959c667e3be3fa96a8785a6f7232;hp=928931901cfe3a387dbdf0cfeca28ce2a0d4d963;hb=bc00d35dbd0f374bb568336dfd1dd40289288b96;hpb=631c05ef31816dfd2c7e8ea0f19a008a1e732605 diff --git a/src/scheme-primitives.4th b/src/scheme-primitives.4th index 9289319..8dad18e 100644 --- a/src/scheme-primitives.4th +++ b/src/scheme-primitives.4th @@ -327,6 +327,38 @@ swap floor swap ; 1 make-fa-primitive flo:floor +:noname ( flonum -- flonum ) + swap ceiling swap +; 1 make-fa-primitive flo:ceiling + +:noname ( flonum -- flonum ) + swap truncate swap +; 1 make-fa-primitive flo:truncate + +:noname ( flonum -- flonum ) + swap fround swap +; 1 make-fa-primitive flo:round + +:noname ( flonum -- flonum ) + drop floor f->i fixnum-type +; 1 make-fa-primitive flo:floor->exact + +:noname ( flonum -- flonum ) + drop ceiling f->i fixnum-type +; 1 make-fa-primitive flo:ceiling->exact + +:noname ( flonum -- flonum ) + drop truncate f->i fixnum-type +; 1 make-fa-primitive flo:truncate->exact + +:noname ( flonum -- flonum ) + drop f->i fixnum-type +; 1 make-fa-primitive flo:round->exact + +:noname ( flonum flonum -- flonum ) + drop swap drop f/ fatan flonum-type +; 2 make-fa-primitive flo:atan2 + \ }}} \ ==== Pairs and Lists ==== {{{