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=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!ucbvax!SEI.CMU.EDU!Alfred.Peterson From: Alfred.Peterson@SEI.CMU.EDU Newsgroups: comp.lang.ada Subject: Re: Need help on float_io format Message-ID: <1987.11.11.16.11.24.Alfred.Peterson@sei.cmu.edu> Date: Wed, 11-Nov-87 11:39:52 EST Article-I.D.: sei.1987.11.11.16.11.24.Alfred.Peterson Posted: Wed Nov 11 11:39:52 1987 Date-Received: Sun, 15-Nov-87 09:22:29 EST References: <7785@steinmetz.steinmetz.UUCP> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: >In FORTRAN, the free format output of 23.35 is 0.2335000+02. >I just discovered that there is no way to let Ada print out 23.35 >as 0.2335000+02. I tried AFT and EXP control parameters and I always got >2.335000+01. Do I miss something? Can any one out there tell me >what's wrong? Thanks in advance. > Ko-Haw Nieh > General Electric Company > Corporate Research and Development > nieh@ge-crd.arpa > 518-387-7431 Yes, unfortunately, Text_Io is REQUIRED to behave as you specify above. ARM 14.3.8 (Input-Output for Real Types) para. 13 states "If EXP has the value zero, then the integer part to be output has as many digits as are needed to represent the integer part of the value of ITEM [in the overloaded procedures PUT above], overriding FORE if necessary, or consists of the digit zero if the value of ITEM has no integer part." The next paragrah states "If EXP has a value greater than zero, then the integer part to be output has a single digit, which is nonzero except for the value 0.0 of ITEM." The ramification of the two paragraphs is that the predefined Text_Io package can NEVER produce the output that you would like and be validable. I believe that the premise for the required Text_Io format is that it follows that of the 'standard' scientific notation form for writing real numbers. Spencer Peterson Member of the Technical Staff Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213 412-269-7608 asp@sei.cmu.edu