From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 Jan 93 16:50:03 GMT From: agate!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.ed u!news.sei.cmu.edu!ajpo.sei.cmu.edu!progers@ucbvax.Berkeley.EDU (Pat Rogers) Subject: Re: Ada Readability, Book Reference Message-ID: <1993Jan5.115003.29978@sei.cmu.edu> List-Id: In article <1993Jan4.174424.5699@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael F eldman) writes: > >Hmmm. How on earth could 1.0/3.0 be exact? What would the value be? > >I checked my Annotated LRM (thanks to Karl Nyberg!) and found AI-00209: >"An implementation can refuse to evaluate a static universal real expression >only if there are insufficient resources to evaluate the expression exactly, >e.g., if there is insufficient memory available. Inexact results must not >be delivered." > >This is interesting. I take it, then, that 1.0/3.0 will be flagged by >the compiler, because - unless a rational representation is being >used, which is always possible, I suppose - there aren't enough bits >in a megabyte to evaluate it exactly. Do compilers use rationals >for this? I'll be back later, after a test or two of this! > >Mike Feldman >------------------------------------------------------------------------ >Michael B. Feldman >co-chair, SIGAda Education Committee > About seven years ago I saw this program (I think by John Squires) on info-ada (this is a reconstruction from memory). See how long it takes your compiler to give up on it -- use a batch queue if you can, especially on a virtual memory machine. If it does eventually compile, you can just add lines until it won't... Pat Rogers progers@ajpo.sei.cmu.edu -------- cut here -------- procedure Killer is A : constant := 1.0 / 3.0; B : constant := A * A * A * A * A * A * A * A * A * A * A * A * A; C : constant := B * B * B * B * B * B * B * B * B * B * B * B * B; D : constant := C * C * C * C * C * C * C * C * C * C * C * C * C; E : constant := D * D * D * D * D * D * D * D * D * D * D * D * D; F : constant := E * E * E * E * E * E * E * E * E * E * E * E * E; G : constant := F * F * F * F * F * F * F * F * F * F * F * F * F; H : constant := G * G * G * G * G * G * G * G * G * G * G * G * G; I : constant := H * H * H * H * H * H * H * H * H * H * H * H * H; J : constant := I * I * I * I * I * I * I * I * I * I * I * I * I; K : constant := J * J * J * J * J * J * J * J * J * J * J * J * J; L : constant := K * K * K * K * K * K * K * K * K * K * K * K * K; begin null; end Killer;