[r6rs-discuss] fixnum->flonum but no flonum->fixnum?
lucier at math.purdue.edu
Fri Mar 21 12:55:06 EDT 2008
On Mar 20, 2008, at 10:03 PM, John Cowan wrote:
> Bradley Lucier scripsit:
>> At any rate, it appears there's a fixnum->flonum, but no flonum-
>>> fixnum; is this intentional? Is there a rationale available?
> I don't know for sure, but the rationale that comes to mind is that
> wouldn't know offhand how the conversion happens. You can already use
> FLOOR to round toward -inf.0, CEILING to round toward +inf.0, TRUNCATE
> to round toward 0, or ROUND to round off. Those should be sufficient.
Well, what I'd really like is for flonum->fixnum to take an integer
flonum in the range of fixnums and convert it to a fixnum. I'd like
it to do all those checks when running in "safe" mode but then assume
that all those checks are satisfied in "unsafe" mode. ("safe" or
"unsafe" running modes aren't in the standard, right?)
More information about the r6rs-discuss