[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: tb@xxxxxxxxxx*Subject*: Re: string->number*From*: Aubrey Jaffer <agj@xxxxxxxxxxxx>*Date*: Thu, 2 Jun 2005 21:59:39 -0400 (EDT)*Cc*: mathematica@xxxxxxxxx, alexshinn@xxxxxxxxx, srfi-70@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-70@xxxxxxxxxxxxxxxxx*In-reply-to*: <87zmu8cynq.fsf@xxxxxxxxxxxxxxxxx> (message from Thomas Bushnell BSG on Thu, 02 Jun 2005 13:05:29 -0700)*References*: <20050531071658.EC10C1167@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050531234805.0EC7F1B77B4@xxxxxxxxxxxxxxxx> <874qcgg4uf.fsf@xxxxxxxxxxxxxxxxx> <20050602161228.B3E3D1B77B4@xxxxxxxxxxxxxxxx> <87hdggentm.fsf@xxxxxxxxxxxxxxxxx> <20050602191022.A42F31B77B4@xxxxxxxxxxxxxxxx> <87zmu8cynq.fsf@xxxxxxxxxxxxxxxxx>

| From: Thomas Bushnell BSG <tb@xxxxxxxxxx> | Date: Thu, 02 Jun 2005 13:05:29 -0700 | | Aubrey Jaffer <agj@xxxxxxxxxxxx> writes: | | > Yes, I should have written "inexact numbers". | | Ok, but when we speak of symbolic "infinite precision" representations | of sqrt(2), presumably we are using exact numbers. No! My point is that inexact numbers correspond to real number neighborhoods; and hence have finite precision. | > Can number->string return a string which can't be READ as a number? | > | > I had thought that 6.2.4 "Syntax of numerical constants" and 7.1.1 | > "Lexical structure" applied to the results of NUMBER->STRING. If they | > are independent, a note about that should be added to the report. | | I think they do, but implementations certainly can extend the syntax | of numbers if they wish (provided that NUMBER->STRING, STRING->NUMBER, | and READ all behave in the expected way). The three groups of features dealing with numerical representation are: * number->string, string->number; * read, write, display; * numerical constants. Section 6.2.3 Implementation restrictions: Although Scheme allows a variety of WRITTEN NOTATIONS for numbers, any particular implementation may support only some of them. Section 6.2.4 Syntax of numerical constants The syntax of the WRITTEN REPRESENTATIONS for numbers is described formally in section Lexical structure. Section 6.2.6 Numerical input and output The procedure `number->string' takes a number and a radix and returns as a string an EXTERNAL REPRESENTATION of the given number in the given radix such that ... Section 6.6.2 Input: `Read' converts EXTERNAL REPRESENTATIONs ... Section 6.6.3 Output: `Write' and `display' create WRITTEN REPRESENTATIONs. The text in section 6.2.6 specifies that `number->string' produces an EXTERNAL REPRESENTATION. Thus the numerical representations produced by `number->string' have the same notation as numerical constants. `Read' converts EXTERNAL REPRESENTATIONs, so it also has the same notation as numerical constants. `number->string' and `string->number' are constrained to use the same representations. The relation between the forms `read' and `write'n is not explicitly stated, but is reasonably assumed to be the same.

**Follow-Ups**:**Re: string->number***From:*Thomas Bushnell BSG

**References**:**Re: infinities reformulated***From:*Chongkai Zhu

**Re: infinities reformulated***From:*Aubrey Jaffer

**Re: infinities reformulated***From:*Thomas Bushnell BSG

**Re: infinities reformulated***From:*Aubrey Jaffer

**Re: infinities reformulated***From:*Thomas Bushnell BSG

**string->number***From:*Aubrey Jaffer

**Re: string->number***From:*Thomas Bushnell BSG

- Prev by Date:
**Re: My suggestions to the R6RS committee about numerics** - Next by Date:
**Re: string->number** - Previous by thread:
**Re: string->number** - Next by thread:
**Re: string->number** - Index(es):