[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: converting decimal to integer
From: |
Marius Vollmer |
Subject: |
Re: converting decimal to integer |
Date: |
Tue, 17 Aug 2004 18:38:07 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
Orm Finnendahl <address@hidden> writes:
> Am 17. August 2004, 17:58 Uhr (+0200) schrieb Aurelien Chanudet:
>>
>> (vector-ref <some vector> (<function I'm looking for>
>> 1.0))
>
> (vector-ref <some vector> (inexact->exact 1.0))
'round' might be needed as well:
(vector-ref <some vector> (inexact->exact (round 1.5)))
The exact equivalent of a real number must not always be an integer.
In Guile 1.7, for example, we have exact fractions:
guile> (inexact->exact 1.5)
3/2
But:
guile> (inexact->exact (round 1.5))
2