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,ecc38b3271b36b88 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: What is the warning about builtin-function on gcc-4.6.0 ? Date: Sat, 26 Mar 2011 16:32:00 +0000 Organization: A noiseless patient Spider Message-ID: References: <87aagiclte.fsf@mid.deneb.enyo.de> <475d10ca-5d4e-490c-9b88-e12cd3cd3faa@b13g2000prf.googlegroups.com> <87d3lejjyv.fsf@mid.deneb.enyo.de> <6c748f70-7e75-49b4-a467-d1d2d6b24323@w9g2000prg.googlegroups.com> <87k4flhoeg.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx01.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="8365"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8l6Aeem0IzLCT3TfqCrAu2q1ML62NyHA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:kex2RwmPanWyrBBXYC6d6mRQfsA= sha1:ouS8QCRBBWH/CHU5+KuWMjVuNco= Xref: g2news2.google.com comp.lang.ada:19443 Date: 2011-03-26T16:32:00+00:00 List-Id: Florian Weimer writes: > * Simon Wright: > >> ytomino writes: >> >>> nn...then, there are no function to take infinity and NaN... >> >> 'Valid should do the trick. >> >> FP_Value := 1.0 / 0.0; >> if FP_Value'Valid then >> -- it won't be > > This is a compiler bug. I don't understand what you mean. If the compiler doesn't raise an exception on division by zero (it's allowed not to, and GNAT doesn't) it will (in this case) set the result to +Inf, and 'Valid will return False. That's for plain [Long_[Long_]]Float. If you've said subtype Real is Float range Float'Range; you'll get a Constraint_Error on assignment of Inf or NaN to a Real.