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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1eaf7620b06b3c3f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-29 13:59:38 PST Path: sparky!uunet!ogicse!usenet.coe.montana.edu!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!convex!sercely From: sercely@convex.com (Ron Sercely) Newsgroups: comp.lang.ada Subject: I/O question Message-ID: <1993Mar29.213438.25890@convex.com> Date: 29 Mar 93 21:34:38 GMT Article-I.D.: convex.1993Mar29.213438.25890 Sender: usenet@convex.com (news access account) Organization: CONVEX Computer Corporation, Richardson, Tx., USA Nntp-Posting-Host: mikey.convex.com X-Disclaimer: This message was written by a user at CONVEX Computer Corp. The opinions expressed are those of the user and not necessarily those of CONVEX. Date: 1993-03-29T21:34:38+00:00 List-Id: Could someone tell me what is supposed to happen with this code? with TEXT_IO; use TEXT_IO; procedure PR30787 is type X_TYPE is digits 15; package MY_IO is new FLOAT_IO(X_TYPE); use MY_IO; X : X_TYPE := (-5000001.84); begin PUT(X, 1, 15, 2); NEW_LINE; end PR30787; On Convex Ada, the PUT raises LAYOUT_ERROR. This seems reasonable given that the RM specifically states that the '-' sign counts as a character, and then the '5' digit that should be output to the left of the decimal point means that "-5" will not fit in a "fore" of 1. On the other hand, although the RM (14.3.5(10) states: "The exception LAYOUT_ERROR is raised by a PUT procedure that outputs to a parameter of type STRING, if the length of the actual string is insufficient for the output of the item". I can't find where the RM states that LAYOUT_ERROR should be raised when the length of a portion of formatted output will not fit into a field of the output, and of course, strictly speaking, this is not output to a parameter of type string. Dec Ada on the other hand prints out the value -5.00000184 without raising an exception. What is "correct".