bug#42012: Reference Manual and Docstring on number->string

<[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
On Tue, Jun 23, 2020 at 12:51:23AM +0200, Sebastian Miele wrote:
> Guile 3.0.3. The reference manual and the docstring of number->string
> say: "If N is inexact, a radix of 10 will be used." But that is not what
> happens, e.g.,
> 
>   (let ((x 4.0)) (and (inexact? x) (number->string x 3)))
> 
> evaluates to "11.0" instead of #f or "4.0". Probably "if RADIX is not
> supplied, a radix of 10 will be used" is meant.

Confirmed for 3.0.2. At first I thought that the fractional part being
zero could be significant (as in your example), but

  scheme@(guile-user)> (number->string 0.3333333333333333 3)
  $5 = "0.1"

is clearly being done in radix 3, fractional part and all.

Cheers
-- t
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAl7xvoQACgkQBcgs9XrR2kYk+ACfU4M/km29NheRod8fGjg0sXzB
pKQAn2Os/9Pebo3EaSPBPQgKwTSSHKJW
=R2kY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.