From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Parameterised 'Image Attributes Date: Wed, 23 Aug 2023 18:16:10 +0200 Organization: A noiseless patient Spider Message-ID: References: <4c861cba-9ad6-429d-b530-a40c45dfc176n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 23 Aug 2023 16:16:08 -0000 (UTC) Injection-Info: dont-email.me; posting-host="5d2fc566cdd20e6ee964b2d9b0417ccc"; logging-data="3152970"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6TBIEkT+Yf2B6GmM84le+cPN7TYY6sp8=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Cancel-Lock: sha1:F8RbZNlhm55HAqWG3MtBpFusB3o= Content-Language: en-US In-Reply-To: <4c861cba-9ad6-429d-b530-a40c45dfc176n@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:65555 List-Id: On 2023-08-23 12:20, Stephen Davies wrote: > Actually, I think it might also be nice if Float'Trim_Image(X) returned > a string that only used exponential notation for very large or very > small values (which seems to be the default behaviour in Python). To use the shortest representation for the given precision unless specified otherwise: http://www.dmitry-kazakov.de/ada/strings_edit.htm#6 Ada 'Image attributes have "typographic quality" in plain contradiction to the claim being for debugging purpose. That is why the plus sign is always represented by a space and why floating-point representation is always selected even for exact zero and the way the exponent part is formatted. The typographic idea is to have *same looking* output. Note, even if the output is mathematically incorrect as in the case of floating-point numbers. 'Image considers precision and accuracy same, which is *always* wrong when dealing with floating-point numbers. > Different names would then be needed (Tidy_Image and Tidy_Width?). It takes several parameters to control the behavior in a reasonable way. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de