unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: 42012@debbugs.gnu.org
Subject: bug#42012: Reference Manual and Docstring on number->string
Date: Tue, 23 Jun 2020 10:34:12 +0200	[thread overview]
Message-ID: <20200623083412.GA3290@tuxteam.de> (raw)
In-Reply-To: <871rm6lno4.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2020-06-23  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 22:51 bug#42012: Reference Manual and Docstring on number->string Sebastian Miele
2020-06-23  8:34 ` tomas [this message]
2020-06-24  3:49   ` Bengt Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623083412.GA3290@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=42012@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).