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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,34a625e98d6a8792,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeed.gamma.ru!Gamma.RU!comstar.ru!teleglobe.net!151.99.250.105.MISMATCH!news.finmeccanica.it!not-for-mail From: "vic" Newsgroups: comp.lang.ada Subject: The right way to handle this difference in Ada Date: Thu, 22 Jul 2004 12:23:09 +0200 Organization: Finmeccanica Message-ID: NNTP-Posting-Host: 192.168.54.114 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Xref: g2news1.google.com comp.lang.ada:2341 Date: 2004-07-22T12:23:09+02:00 List-Id: Hello, I'm starting to develope in Ada 95, but as I come from C++ language I'm having some difficulties about strong typing. Please consider this type: type unsigned_int_12_type is range 0..(2*12)-1; and these 2 variables of the above type: a: unsigned_int_12_type; b: unsigned_int_12_type; If the code must perform a difference between a and b, say: c := a-b 1) which should be the type of c? I think it should be something like: type signed_int_12_type is range -unsigned_int_12'last .. unsigned_int_12'last. Is this right? 2) And I should rename a "-" operation which gets two signed_int_12_type as operands and returns signed_int_12_type as result? Thanks, vic