[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42012: Reference Manual and Docstring on number->string
From: |
tomas |
Subject: |
bug#42012: Reference Manual and Docstring on number->string |
Date: |
Tue, 23 Jun 2020 10:34:12 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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
Description: Digital signature