[Oberon] exponential notation for REALs

Dieter d.gloetzel at web.de
Thu Sep 20 16:14:20 CEST 2018


Thanks, Jörg!

It works, but I do not find this very logical.

The developer of Module Strings could have spent 5 Minutes on this feature.

Regards, Dieter

Am 20.09.2018 um 15:23 schrieb Jörg:
> Delete the "+".
> Jörg
>
>
> -----Original Message-----
> From: Oberon <oberon-bounces at lists.inf.ethz.ch> On Behalf Of Dieter
> Sent: Thursday, September 20, 2018 2:38 PM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] exponential notation for REALs
>
> PLease have a look at the example (ETHOberon on Windows):
> =====================================================
> MODULE testread;
> IMPORT Strings,Out;
> (* Test for reading REAL Numbers with exponential. *) PROCEDURE test*; VAR s
> : ARRAY 20 OF CHAR; r : LONGREAL; BEGIN
>       COPY ("5.02024D+007", s); Strings.StrToReal(s,r); Out.LongReal(r,15);
> END test; BEGIN END testread.test
>
> System.Free testread ~
> ===================================================
> What ever I try, the exponential gets lost and the result is:
> 5.020240D+000
> Has anybody got an explanation or a proposal how to read in Floating Point
> numbers with exponential.
>
> Regards, Dieter
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>



More information about the Oberon mailing list