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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: 64-bit unsigned integer? Date: Sun, 25 Feb 2018 17:35:32 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <63f986fd-662a-47e7-adf9-5fddc243ac45@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 25 Feb 2018 16:35:32 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="97ee91d193ed2b0b71b32790d65f2144"; logging-data="12238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19m9hetP6lQC4kzDpZoj5zQFcnEgbiNmPY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: <63f986fd-662a-47e7-adf9-5fddc243ac45@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:ury4Giwb2OnDe7+3W5nrYMStyL4= Xref: reader02.eternal-september.org comp.lang.ada:50642 Date: 2018-02-25T17:35:32+01:00 List-Id: On 02/25/2018 01:54 PM, MM wrote: > > I don't want to go the BigNum route - too heavyweight. Implementing it > efficiently myself may require access to the processor's condition code > registers, so this feels like an assembly language approach? I'm sure the processor has operations that set the overflow flag. You could write machine-code insertions that invoke them and check the flag, but that doesn't seem like the best way to proceed. I consider this a fault in the language design. There are two orthogonal concepts: whether the representation is signed or not, and whether overflow is detected or not. Mixing them together was a mistake. GNAT had support for 64-bit integers before 64-bit processors were common, so it must have chained 2 32-bit integers together. One could hope that, now that 64-bit processors are common, they'll support 128-bit integers. -- Jeff Carter "You empty-headed animal-food-trough wiper." Monty Python & the Holy Grail 04