[racket] numbers/bytes in r6rs

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Dec 26 09:07:19 EST 2010

In racket you'd use this function, fwiw:

  (λ (n) (bytes-length (string->bytes/utf-8 (format "~s" n))))

(or possibly a variant of it depending on the encoding you were using).


On Sun, Dec 26, 2010 at 2:52 AM, Wolfgang De Meuter <wdmeuter at vub.ac.be> wrote:
> Hello
> I'm struggling with chapter 2 of the R6RS libraries (relation between Scheme data objects and bytevectors). Does anyone know a clean&simple way for
> - determining the number of bytes needed to push an arbitrary-sized number in a bytevector;  (log nbr 256) is not good enough :-)
> - determining whether a floating point number is a double or a single.
> I guess that I must be lacking knowledge about some of the primitives.
> Thx
> Wolf
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.