emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ?


From: Toru TSUNEYOSHI
Subject: Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ?
Date: Sun, 25 Oct 2009 17:51:31 +0900

From: Stefan Monnier <address@hidden>

> I think the problem is that FIXNUM_OVERFLOW_P is written to handle an
> integer argument, not a float argument.  So rather than patch it to use
> floats, I'd rather write a new macro that works for floats (and only
> casts the MOST_POSITIVE_FIXNUM side).
> 
> 
>         Stefan

I made a new macro.
Probably, it doesn't depend on variable type, I think.
Would you like to check it?

#define FIXNUM_OVERFLOW_P(i)             \
  ((i) > 0                               \
   ? (i) != MOST_POSITIVE_FIXNUM         \
     && (i) / MOST_POSITIVE_FIXNUM >= 1  \
   : (i) != MOST_NEGATIVE_FIXNUM         \
     && (i) / MOST_NEGATIVE_FIXNUM >= 1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]