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: 109fba,cd8ed9115942852f X-Google-NewGroupId: yes X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gid4f1905883f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Thu, 11 Aug 2011 00:49:32 +0200 Organization: A noiseless patient Spider Message-ID: <87pqkc6fwj.fsf@ludovic-brenta.org> References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="P+hyzu9l+y6kiWEXEUx+Yw"; logging-data="13976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gS6FnAxyn5dmJt2lLqIhe" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:tL8O0pBcQp+WK0YAl+hOgpF9qWE= sha1:NLuHMwhjvTUqf5xxL5TTGQTUm7E= Xref: g2news1.google.com comp.lang.c++:82795 comp.lang.ada:20521 Date: 2011-08-11T00:49:32+02:00 List-Id: "Randy Brukardt" writes on comp.lang.ada: > "Niklas Holsti" wrote in message > news:9ag33sFmuaU1@mid.individual.net... > ... >> In what way does Ada (95, or the current standard 2005) not support your >> needs for unsigned types? > > I'm not the OP, but... > >> If you dislike the wrapping behaviour of the Ada "modular" unsigned types, >> what is wrong with defining your own unsigned integer type in Ada, as in >> >> type My_Number is range 0 .. 53621; > > This does not work on the largest unsigned integer type (mod 2**32 in > Janus/Ada). Presuming Max_Int = 2**31 - 1, then I'd say range 0 .. 53621 is perfectly legal. It would only be illegal on a 16-bit machine. > Ada 95 requires > > type My_Number is range 0 .. 2**32-1; > > to be rejected, as the upper bound exceeds Max_Int. (This is > technically a "signed_integer_type_definition", which shows the cause > of the problem.) But this simply stems from the requirement that Ada be efficiently implementable on this target hardware, which has 32-bit integers. -- Ludovic Brenta.