(vector-set! bucket (truncate x) y)

From: Ben L. Di Vito <b.l.divito_at_larc.nasa.gov>
Date: Fri, 11 Aug 2000 15:38:14 -0400 (EDT)

Ron Stanonik writes:
>
> So, truncate isn't returning an integer. Sorry if this is a newbie
> question, but how do I get an integer from a real?

Just apply the inexact->exact conversion:

  STk> (inexact->exact (truncate 5.3))
  5

This conversion function should be described in the standard Scheme books
along with other issues related to exact vs. inexact numbers.


---
    Ben Di Vito                     b.l.divito_at_larc.nasa.gov
    1 South Wright Street, MS 130   http://shemesh.larc.nasa.gov/~bld
    NASA Langley Research Center    voice: +1-757-864-4883
    Hampton, VA 23681   USA         fax:   +1-757-864-4234
Received on Fri Aug 11 2000 - 21:14:16 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST