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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a7135c0f450945a5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!newsfeed.freenet.de!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: How to convert a string containing two hex digits to a character? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <93bb3b0f-1140-4fb7-8d7e-d97af3b57aaa@m16g2000yqc.googlegroups.com> <74e3d1de-b560-442d-8190-f3285ee31b0c@f5g2000yqh.googlegroups.com> <2m4g35mnk59z$.xhxh0f7riqad.dlg@40tude.net> <1a68twjk8xoel.16vicep9cbrn2.dlg@40tude.net> <1eb0d4a1-8ad0-442a-b9aa-2b41a3f3a8db@d20g2000yqh.googlegroups.com> Date: Mon, 11 Jan 2010 19:13:01 +0100 Message-ID: NNTP-Posting-Date: 11 Jan 2010 19:13:00 CET NNTP-Posting-Host: f600ad53.newsspool2.arcor-online.net X-Trace: DXC=D[f]JGHcDG:T2Rfi6[coEIgo3dJ`? X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8696 Date: 2010-01-11T19:13:00+01:00 List-Id: On Mon, 11 Jan 2010 07:53:14 -0800 (PST), Adam Beneschan wrote: > On Jan 9, 8:04�am, "Dmitry A. Kazakov" > wrote: > >>> There are no Pred and Succ on reals, complexes and the likes, >> >> BTW, there is Float'Succ! I tempted to say due to a language design flaw, >> because it exposes the nature of Float as a model. > > I don't see this is a flaw. It's a reminder that a Float, on any > computer, in any language, is actually limited to a subset of rational > numbers, Technically no: 1. the radix can be irrational = you can have a finite set or irrational numbers 2. infinite sets of rational numbers still have no Succ But I know what you meant. Yes any set of model numbers is finite. BUT that alone is not enough to have Succ well-defined. Consider the model x=P/Q, where P and Q are bignums. In this model of real numbers there is no meaningful Succ. > which means you need to exercise some caution when using > them. Programmers who think "Float" can represent any real number, > and that arithmetic on them is just like doing arithmetic on real > numbers, are going to get into trouble, so it doesn't seem like a good > thing to hide "the nature of Float as a model". But also using operations specific to the given implementation (model) make the program fragile. I think that Succ is OK for fixed-point numbers, but less sure in the case of floating-point ones. > Anyway, Float'Succ was not present in Ada 83 but was added in Ada 95, > so someone must have thought it was useful for some practical purpose. They also added 'Adjacent, which could serve same purpose. However upper and lower pairs +,-,*,/ would be more useful. (Upper + is greater or equal to the exact +). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de