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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bce83a1d41e2ae2b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-19 18:25:21 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!144.212.100.101!newsfeed.mathworks.com!howland.erols.net!newshub2.home.com!news.home.com!news1.frmt1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: error output numbers References: <995tlj$sd5$1@nh.pace.co.uk> X-Newsreader: Tom's custom newsreader Message-ID: <0azt6.52640$zV3.4149616@news1.frmt1.sfba.home.com> Date: Tue, 20 Mar 2001 02:22:52 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 985054972 24.20.190.201 (Mon, 19 Mar 2001 18:22:52 PST) NNTP-Posting-Date: Mon, 19 Mar 2001 18:22:52 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:5880 Date: 2001-03-20T02:22:52+00:00 List-Id: > > I decleared all outputs to be INTEGER. > The correct result is in excess of six billion. A garden variety integer is > only good to 2**31 - or around two billion - on most Ada implementations. This seems an excellent demonstration of the advantages of using your own declared integer types, rather than whatever your current compiler happens to be offering today. If the declaration was type Factorial_Values is range 1 .. 999_999_999; it would be clear that a value of a billion or more won't work. OTOH, type Factorial_Values is range 1 .. 999_999_999_999; would let the compiler know it better use more than 32 bits, and it would be clear exactly how big a factorial value would still work.