comp.lang.ada
 help / color / mirror / Atom feed
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
Date: 5 Jan 93 16:50:03 GMT	[thread overview]
Message-ID: <1993Jan5.115003.29978@sei.cmu.edu> (raw)

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;

             reply	other threads:[~1993-01-05 16:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-05 16:50 agate!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.ed [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-01-05 12:55 Ada Readability, Book Reference Robert Firth
1993-01-04 23:19 Tucker Taft
1993-01-04 17:44 Michael Feldman
1993-01-04  9:31 agate!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!nobeltech
1993-01-03 15:28 Orville R. Weyrich
1992-12-30  3:51 Michael Feldman
1992-12-29 19:35 Alex Blakemore
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox