This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

exactness


This has bothered me for a long time:

(/ 5 2) => 2.5

This is _very_ impractical, as well as breaks r4rs:

A number is exact if it was written as an exact constant or was derived
from exact numbers using only exact operations. 

Is there some good reason for this? Also:

(floor 2.5) => 2.0

Is there some reason why this doesn't return an exact 2?

Right now, if I need to do even simple things like get half of a list, I need
to do

(list-tail lst (inexact->exact (floor (/ (length lst) 2))))

In short, urk.


Lauri Alanko
la@iki.fi