guile-devel
[Top][All Lists]
Advanced

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

Re: real numbers and integer-expt.


From: Marius Vollmer
Subject: Re: real numbers and integer-expt.
Date: 20 Mar 2002 23:32:25 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Rob Browning <address@hidden> writes:

> Marius Vollmer <address@hidden> writes:
> 
> > Yes.  Floats can be integers, too.  However, there's a bug
> > nevertheless: floats can represent integers that don't fit into 32
> > bit ints.  Also, complex numbers can be ints as well.
> 
> OK, that's a bit confusing -- we have SCM_COMPLEXP which does *not*
> mean the same thing as scm_complex_p -- the former checks to make sure
> the object, tag-wise, is a complex smob, the latter checks to see if
> the object actually contains a complex number, so we have
> 
>   (complex? 3) -> #t
> 
> but
> 
>   SCM_COMPLEX(SCM_MKINUM(3)) -> 0

Yes, good point.  I wasn't aware of that.


I guess we need to first answer what the purpose of 'integer-expt' is.
Given 'expt' is it useful to have 'integer-expt' as well?  Is
integer-expt really only for exact numbers and not for integers?  Is
it just a subset of 'expt' for use from C code?



reply via email to

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