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: a07f3367d7,e1bb40a3d604c4b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: What is the best way to convert Integer to Short_Short_Integer? Date: Tue, 22 Jun 2010 14:48:05 -0700 Organization: None to speak of Message-ID: References: <3133a7d5-37ec-4db7-94f0-df15b3535af1@k39g2000yqb.googlegroups.com> <24e3f643-5bb5-44c9-89ec-093247f6c194@w12g2000yqj.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 22 Jun 2010 21:49:22 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="9nFTuw1iclElqUG5+//YDQ"; logging-data="3048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/C8FwqmcfWUFmFqXBgfhE+" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:UVo0VCCopFi9F8psLIhYAQAIJ38= sha1:w9WOG2p8UEEqCm++5ndcrQUMBdQ= Xref: g2news1.google.com comp.lang.ada:11874 Date: 2010-06-22T14:48:05-07:00 List-Id: "Martin Krischik" writes: > Am 14.06.2010, 18:45 Uhr, schrieb Keith Thompson : > >> Not all Ada compilers implement Short_Short_Integer, but all Ada >> compilers do implement: >> type My_Type is range -128 .. 127; > > for My_Type'Size use 8; > > otherwise you type might not be as short as you think it is. That depends on whether you care about the size, or only about the range. It might also be rejected if the implementation doesn't use two's-complement. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"