+/* Convert float to Lisp_Int if it fits, else signal a range error
+ using the given arguments. */
+#define FLOAT_TO_INT(x, i, name, num) \
+ do \
+ { \
+ if ((x) >= (((EMACS_INT) 1) << (VALBITS-1)) || \
+ (x) <= - (((EMACS_INT) 1) << (VALBITS-1)) - 1) \
+ range_error (name, num); \
+ XSETINT (i, (EMACS_INT)(x)); \
+ } \
+ while (0)
+#define FLOAT_TO_INT2(x, i, name, num1, num2) \
+ do \
+ { \
+ if ((x) >= (((EMACS_INT) 1) << (VALBITS-1)) || \
+ (x) <= - (((EMACS_INT) 1) << (VALBITS-1)) - 1) \
+ range_error2 (name, num1, num2); \
+ XSETINT (i, (EMACS_INT)(x)); \
+ } \
+ while (0)
+
+#define arith_error(op,arg) \
+ Fsignal (Qarith_error, Fcons (build_string ((op)), Fcons ((arg), Qnil)))
+#define range_error(op,arg) \
+ Fsignal (Qrange_error, Fcons (build_string ((op)), Fcons ((arg), Qnil)))
+#define range_error2(op,a1,a2) \
+ Fsignal (Qrange_error, Fcons (build_string ((op)), \
+ Fcons ((a1), Fcons ((a2), Qnil))))
+#define domain_error(op,arg) \
+ Fsignal (Qdomain_error, Fcons (build_string ((op)), Fcons ((arg), Qnil)))
+#define domain_error2(op,a1,a2) \
+ Fsignal (Qdomain_error, Fcons (build_string ((op)), \
+ Fcons ((a1), Fcons ((a2), Qnil))))