kreal.h (886B)
1 /* 2 ** kreal.c 3 ** Kernel Reals (doubles) 4 ** See Copyright Notice in klisp.h 5 */ 6 7 #ifndef kreal_h 8 #define kreal_h 9 10 #include <stdbool.h> 11 #include <stdint.h> 12 #include <inttypes.h> 13 14 #include "kobject.h" 15 #include "kstate.h" 16 #include "kinteger.h" 17 #include "krational.h" 18 #include "imrat.h" 19 20 /* REFACTOR rename. These can take any real, but 21 kreal_to_... is taken by kgnumbers... */ 22 TValue kexact_to_inexact(klisp_State *K, TValue n); 23 TValue kinexact_to_exact(klisp_State *K, TValue n); 24 25 26 double kdouble_div_mod(double n, double d, double *res_mod); 27 double kdouble_div0_mod0(double n, double d, double *res_mod); 28 29 TValue kdouble_to_integer(klisp_State *K, TValue tv_double, kround_mode mode); 30 31 /* 32 ** read/write interface 33 */ 34 int32_t kdouble_print_size(TValue tv_double); 35 void kdouble_print_string(klisp_State *K, TValue tv_double, 36 char *buf, int32_t limit); 37 38 #endif