home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1989-01-09 | 2.5 KB | 59 lines |
- DEFINITION MODULE ConvertReal;
- (* File name: ConvertReal.def *)
- (* Creation : Orginal Montan File *)
- (* Function : Change Real to String and String to Real *)
- (* By : Philip E. Rosine *)
- (* *)
- (*
- * Copyright (c) 1985,1986,1987,1988,1989 by
- * ana-systems, Foster City, California.
- * All Rights Reserved.
- *
- * This software is furnished under a license and may be used and copied
- * only in accordance with the terms of such license and with the
- * inclusion of the above copyright notice. This software or any other
- * copies thereof may not be provided or otherwise made available to any
- * other person. No title to and ownership of the software is herby
- * transferred.
- *
- * The information in this software is subject to change without notice
- * and should not be construed as a commitment by ana-systems. No
- * warranty is implied or expressed.
- *
- * SCCID = "1.1 1/26/86";
- *)
- (* History of modifcation *)
- (* Date Who Why *)
- (* 7/18/85 Morris Changes for BSL *)
- (* *)
-
- (* as defined by Wirth,1983, pp104-5
- entered by Philip E. Rosine
- 25 Nov 83 *)
-
- EXPORT QUALIFIED RealToStr, StrToReal;
-
-
- PROCEDURE StrToReal( VAR str : ARRAY OF CHAR;
- VAR real : REAL;
- VAR success : BOOLEAN);
-
- (* Read REAL number x according to syntax:
- ["+"|"-"]digit{digit}["."digit{digit}]["E"["+"|"-"]digit[digit]]
- Done := "a number was read".
- At most 7 digits are significant, leading zeroes not
- counting. Maximum exponent is 38. Input terminates
- with a blank or any control character. DEL is used for
- backspacing. *)
-
- PROCEDURE RealToStr( real : REAL;
- VAR str : ARRAY OF CHAR;
- width : CARDINAL;
- decPlaces : CARDINAL;
- VAR success :BOOLEAN );
- (* Write x using n characters. If fewer than n
- characters are needed, leading blanks are inserted. *)
-
-
- END ConvertReal.
-