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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd8c808621763c34 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: help Please Date: 1999/01/27 Message-ID: #1/1 X-Deja-AN: 437581681 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <36AEE12E.A97785D2@gecm.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1999-01-27T00:00:00+00:00 List-Id: Steve Kerr (stephen.kerr@gecm.com) wrote: : ... : This does though raise an interesting point though (assuming that the same rules : apply to the image attribute), how does Ada95 decide on the string : representation of a floating point number for the image attribute ? i.e. how : many decimal places to display and whether to display an exponent, particulaly : where the float can be represented without an exponent (e.g. 0.1234). My guess : is that this is compiler dependant, does anyone know different ? Oh please, not compiler dependent! ;-). There is actually a surprisingly easy way to find this out, and that is to look in the Ada 95 Reference Manual. (I suspect you will quickly be bombarded with repeats of this answer!) The relevant paragraph is RM95 3.5(33): The image of a floating point value is a decimal real literal best approximating the value (rounded away from zero if halfway between) with a single leading character that is either a minus sign or a space, a single digit (that is nonzero unless the value is zero), a decimal point, S'Digits-1 (see 3.5.8) digits after the decimal point (but one if S'Digits is one), an upper case E, the sign of the exponent (either + or -), and two or more digits (with leading zeros if necessary) representing the exponent. If S'Signed_Zeros is True, then the leading character is a minus sign for a negatively signed zero. So the quicker answer is: Min(S'Digits-1, 1) digits after the decimal point, and there will always be an exponent (ugly as that may be ;-). -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA