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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8c0fcfc0a87e61fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: simple question on long_float/short_float Date: Sat, 02 Oct 2010 21:09:26 +0100 Organization: A noiseless patient Spider Message-ID: References: <1fwh82m3de16h$.7aw204c9j2tj.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 2 Oct 2010 20:09:26 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="29726"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bj54cv3gHm2J4Q01clkFcL5OoYbh+YKs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:XtbQlKM4zsOv6yTfVG4EAv+ngqs= sha1:zLjakr3aWB0jmQy7mJS2Jh8W7n0= Xref: g2news1.google.com comp.lang.ada:14359 Date: 2010-10-02T21:09:26+01:00 List-Id: "Dmitry A. Kazakov" writes: > I doubt it much. IEEE 754 is a normal floating-point + some > non-numbers like NaN. As the name suggests, numeric computations are > performed on *numbers*. IEEE 754 non-numbers might be useful for the > languages with no means to deal with numeric errors. But in Ada you > don't need that because Ada has numeric exceptions. But GNAT doesn't raise numeric exceptions for floating-point computations resuting in Inf or NaN ('Machine_Overflows is False). You can use 'Valid, or you can define the range as Dmitry noted above (range Float'Range, I think) in which case you get Constraint_Error on overflow.