GNU bug report logs - #42012
Reference Manual and Docstring on number->string

Previous Next

Package: guile;

Reported by: sebastian.miele <at> gmail.com

Date: Mon, 22 Jun 2020 22:52:01 UTC

Severity: normal

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <tomas <at> tuxteam.de>
To: bug-guile <at> gnu.org
Subject: Re: bug#42012: Reference Manual and Docstring on number->string
Date: Tue, 23 Jun 2020 10:34:12 +0200
[Message part 1 (text/plain, inline)]
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, inline)]

This bug report was last modified 4 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.