Re: question about the function 'round' in rep
- From: Nathan Froyd <froydnj gmail com>
- To: General discussion about sawfish wm <sawfish-list gnome org>
- Subject: Re: question about the function 'round' in rep
- Date: Tue, 1 Sep 2009 14:19:37 -0400
On Tue, Sep 1, 2009 at 12:40 PM, Christopher Roy
Bratusek<zanghar freenet de> wrote:
>> (integerp (round 2.3)) -> t
>>
>> So 2. is an integer. But why is my 1st. command wrong?
>
> This is the round function (librep/numbers.c), in case you want to
> investigate more:
>
> case rep_NUMBER_FLOAT:
> return rep_make_float (floor (rep_NUMBER (arg,f)), rep_TRUE);
> }
It's quite confusing for INTEGERP to return T for (ROUND 2.3), but
have MOVE-WINDOW-TO--which presumably expects integers--to complain
about being given the result of (ROUND 2.3). Also, the documentation
for ROUND suggests that it really does return an integer, not a
floating-point number that represents an integer.
-Nathan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]