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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Re: Disallowing Pre-Defined Operations Date: 2000/04/07 Message-ID: <38EE267E.12466F1E@quadruscorp.com>#1/1 X-Deja-AN: 608024960 Content-Transfer-Encoding: 7bit References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <38D2E598.262D1CD5@erols.com> <8b0pbg$aph$1@nnrp1.deja.com> <38D9A2E8.F720768@erols.com> <8bcalg$pmb$1@nnrp1.deja.com> <38EBDD10.65444727@earthlink.net> <38EC160F.E2A13F44@quadruscorp.com> <8cic1h$195$1@nnrp1.deja.com> <38ED3145.BE3CEC68@quadruscorp.com> <38EE18A8.FD5F1A05@quadruscorp.com> <8ckre7$o2p2@ftp.kvaerner.com> Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 7 Apr 2000 15:20:07 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-07T15:20:07+00:00 List-Id: Tarjei T. Jensen wrote: > Why should it be slow??? All (at least most) of the action should be at the > compile stage. That is when the checking is done. The generated code should run > as usual. > > All that happens is that there should be fewer run-time errors to discover > since the universe describe all the legal operatons with the various datatypes. > If you try to multiply velocities the compiler will tell you that it is not > legal. > Maybe you missed the point. The checks *must* be at runtime - similar to Constraint_Error except that no exception gets raised. When the value exceeds the range, the object is saturated to its max/min value. This is inherently slow in that you can't just do the math, but have to check results and saturate at every step of the way. (Unless the hardware has direct support for it. I've not encountered that anywhere, but that doesn't mean it doesn't exist.) Given that an application may perform thousands - or millions - of math operations, adding the extra overhead can get quite costly. In hard real time situations where saturated math is quite a common desire, you often need to get the math done in extremely small amounts of time. So you want code that is as totally optimized as possible. MDC -- ============================================================= Marin David Condic - Quadrus Corporation - 1.800.555.3393 1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233 http://www.quadruscorp.com/ m c o n d i c @ q u a d r u s c o r p . c o m ***PLEASE REMOVE THE "-NOSPAM" PART OF MY RETURN ADDRESS*** Visit my web site at: http://www.mcondic.com/ "I'd trade it all for just a little more" -- Charles Montgomery Burns, [4F10] =============================================================