double db = XFLOAT_DATA (Ffloat_time (b));
return make_float (subtract ? da - db : da + db);
}
- if (FLOATP (b) && !isfinite (XFLOAT_DATA (b)))
- return subtract ? make_float (-XFLOAT_DATA (b)) : b;
-
enum timeform aform, bform;
struct lisp_time ta = lisp_time_struct (a, &aform);
+ if (FLOATP (b) && !isfinite (XFLOAT_DATA (b)))
+ return subtract ? make_float (-XFLOAT_DATA (b)) : b;
+
/* Subtract nil from nil correctly, and handle other eq values
quicker while we're at it. Compare here rather than earlier, to
handle NaNs and check formats. */
(cons (1+ most-positive-fixnum) 1000000000000)
(cons 1000000000000 (1+ most-positive-fixnum)))))
(dolist (a time-values)
+ (should-error (time-add a 'ouch))
+ (should-error (time-add 'ouch a))
+ (should-error (time-subtract a 'ouch))
+ (should-error (time-subtract 'ouch a))
(dolist (b time-values)
(let ((aa (time-subtract (time-add a b) b)))
(should (or (time-equal-p a aa) (and (floatp aa) (isnan aa)))))