/* Recording what needs to be marked for gc. */
struct gcpro *gcprolist;
-
-static void
-XFLOAT_INIT (Lisp_Object f, double n)
-{
- XFLOAT (f)->data = n;
-}
-
\f
/************************************************************************
Malloc
Lisp_Object
make_float (double float_value)
{
- register Lisp_Object val;
- struct Lisp_Float *p;
-
- p = xmalloc (sizeof *p);
- SCM_NEWSMOB (p->self, lisp_float_tag, p);
- XSETFLOAT (val, p);
- XFLOAT_INIT (val, float_value);
- return val;
+ return scm_from_double (float_value);
}
-
\f
/***********************************************************************
Cons Allocation
lisp_string_tag = scm_make_smob_type ("elisp-string", 0);
lisp_vectorlike_tag = scm_make_smob_type ("elisp-vectorlike", 0);
lisp_cons_tag = scm_make_smob_type ("elisp-cons", 0);
- lisp_float_tag = scm_make_smob_type ("elisp-float", 0);
/* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */
((ok) ? (void) 0 : (void) wrong_type_argument (predicate, x))
#define lisp_h_CONSP(x) (SMOB_TYPEP (x, lisp_cons_tag))
#define lisp_h_EQ(x, y) (scm_is_eq (x, y))
-#define lisp_h_FLOATP(x) (SMOB_TYPEP (x, lisp_float_tag))
+#define lisp_h_FLOATP(x) (x && SCM_INEXACTP (x))
#define lisp_h_INTEGERP(x) (SCM_I_INUMP (x))
#define lisp_h_MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
#define lisp_h_MISCP(x) (SMOB_TYPEP (x, lisp_misc_tag))
scm_t_bits lisp_string_tag;
scm_t_bits lisp_vectorlike_tag;
scm_t_bits lisp_cons_tag;
-scm_t_bits lisp_float_tag;
enum Lisp_Type
{
LISP_MACRO_DEFUN (XSYMBOL, struct Lisp_Symbol *, (Lisp_Object a), (a))
-INLINE struct Lisp_Float *
-XFLOAT (Lisp_Object a)
-{
- eassert (FLOATP (a));
- return SMOB_PTR (a);
-}
-
/* Pseudovector types. */
INLINE struct Lisp_Process *
#define XSETVECTOR(a, b) ((a) = (b)->header.self)
#define XSETSTRING(a, b) ((a) = (b)->self)
#define XSETSYMBOL(a, b) ((a) = (b)->self)
-#define XSETFLOAT(a, b) ((a) = (b)->self)
#define XSETMISC(a, b) (a) = ((union Lisp_Misc *) (b))->u_any.self
/* Pseudovector types. */
return &a->u_buffer_objfwd;
}
\f
-/* Lisp floating point type. */
-struct Lisp_Float
- {
- Lisp_Object self;
- double data;
- };
-
-INLINE double
-XFLOAT_DATA (Lisp_Object f)
-{
- return XFLOAT (f)->data;
-}
+#define XFLOAT_DATA(f) (scm_to_double (f))
/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
representations, have infinities and NaNs, and do not trap on