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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham 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!postnews.google.com!j5g2000yqm.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: How to convert a string containing two hex digits to a character? Date: Fri, 15 Jan 2010 11:59:28 -0800 (PST) Organization: http://groups.google.com Message-ID: <95653745-d21d-4cf9-8604-315ff185021a@j5g2000yqm.googlegroups.com> 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> NNTP-Posting-Host: 86.66.190.231 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1263585568 24999 127.0.0.1 (15 Jan 2010 19:59:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 15 Jan 2010 19:59:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j5g2000yqm.googlegroups.com; posting-host=86.66.190.231; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8768 Date: 2010-01-15T11:59:28-08:00 List-Id: On 11 jan, 16:53, Adam Beneschan wrote: > I don't see this is a flaw. =A0It's a reminder that a Float, on any > computer, in any language, is actually limited to a subset of rational > numbers, which means you need to exercise some caution when using > them. =A0Programmers 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". > > 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. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Adam While I agree with Dimitry Pred and Succ on Float are mostly a strange idea, I agree Float (computer floats) and reals are not the same. Just to give a good example about, a Python methods associated to Float : float.as_integer_ratio(), which is defined as : > Return a pair of integers whose ratio is exactly equal to the original fl= oat > and with a positive denominator. Raises OverflowError on infinities and a > ValueError on NaNs. Found here : http://docs.python.org/library/stdtypes.html Funny to apply this on Pi :P Yes, Floats are a special things, they are not reals, although this can be formalized