Xref: utzoo comp.sys.mips:408 comp.lang.pascal:2904 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!mips!batman!zaineb From: zaineb@mips.COM (Zaineb Asaf) Newsgroups: comp.sys.mips,comp.lang.pascal Subject: Re: pascal writeln format error? Keywords: pascal,writeln Message-ID: <34282@mips.mips.COM> Date: 9 Jan 90 22:46:34 GMT References: <15473@boulder.Colorado.EDU> Sender: news@mips.COM Reply-To: zaineb@mips.COM (Zaineb Asaf) Followup-To: comp.sys.mips Distribution: comp.sys.mips,comp.lang.pascal Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 34 >>From: putz@boulder.Colorado.EDU (Eric Putz) >>I am having a problem getting writeln to output a number with a decimal value >>of 0, not in the 'e' format, and am not sure if this is a compiler bug, or >>a feature of pascal. I have tried the following lines with the following >>results: writeln(1.0:1:0) gives me 1.0e+00. >>What I was hoping for was 1 when writeln was given a decimal value of 0. >>All other decimal values I have tried (> 0) have worked correctly. The >>compiler I am using is MIPS Pascal 2.0 (from RISC/os4.00 & cmplrs2.0) on >>an M2000. Any thoughts? Thanks in advance. The above statement is incorrect according to Standard Pascal. The standard states: write(e:TotalWidth:FracDigits); where the "values of TotalWidth and FracDigits shall be greater than or equal to one; it shall be an error if either value is less than one" Therefore, this problem is a user error; however, the compiler will be changed to give a runtime error if this situation will happen. Thanks for pointing out this error for us. Zaineb -- -- zaineb Asaf UUCP: {ames,decwrl,prls,pyramid}!mips!zaineb (or zaineb@mips.com) DDD: 408-991-0347 (or 408-720-1700, Ext. 347) USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086-3650