On 04/24/2013 10:01 PM, Mikael wrote:
Hi Brad,
((##ratnum? n) (##inexact->exact (##floor n)))
The floor of a ratnum is always exact, so you could save a trampoline call here by not calling inexact->exact.
About the semantics of numerical operations in Scheme---I don't really know what to say. I'd suggest thinking of all operations as the same as in grade-school mathematics with integers of arbitrary size, rational numbers, etc. Then layer on top of that some understanding of how flonums work and how they interact with other types of numbers. It's hard to get the conventions of other languages out of one's head.
Brad