From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,91965a012526b259 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Float to String Date: Thu, 11 Nov 2004 18:01:11 -0600 Organization: Cuivre, Argent, Or Message-ID: References: <24Bkd.74362$HA.12207@attbi_s01> <9qNkd.24057$KJ6.14615@newsread1.news.pas.earthlink.net> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1100217722 76114 212.85.156.195 (12 Nov 2004 00:02:02 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 12 Nov 2004 00:02:02 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: "Jeffrey Carter" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6158 Date: 2004-11-11T18:01:11-06:00 No, it is not an error. Note that the Separators string contains three characters, blank, plus, and minus. So, To_Real wants one of those three characters to separate the mantissa and the exponent. ----- Original Message ----- From: "Jeffrey Carter" Newsgroups: comp.lang.ada To: Sent: November 11, 2004 11:36 AM Subject: Re: Float to String > David C. Hoos, Sr. wrote: > >> function To_Real >> (Representation : String) >> return Real >> is >> Separator : Natural; >> Separators : constant String := " +-"; > > ... > >> Separator := Ada.Strings.Fixed.Index >> (Representation (Representation'First + 1 .. Representation'Last), >> Ada.Strings.Maps.To_Set (separators)); >> if Separator = 0 then >> Raise_With_Message; >> end if; > > ... > >> function To_String (Value : Real) return String > > ... > >> return Mantissa_String & Integer'Image (Exponent); > > Is this an error? To_Real wants a sign on the exponent ('+' or '-') but > Integer'Image does not add '+' to non-negative values. > > -- > Jeff Carter > "If a sperm is wasted, God gets quite irate." > Monty Python's the Meaning of Life > 56 > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada > >