[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Are there standard functions such as FLOAT and TRUNC?
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Are there standard functions such as FLOAT and TRUNC? |
Date: |
Thu, 18 Feb 2010 11:14:59 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Fischlin Andreas <address@hidden> writes:
> Dear all,
>
> I recommend to use assignment compatibility if you wish to convert
> among reals of different precision. This means:
>
> VAR
> rs: SHORTREAL;
> r: REAL;
> rl: LONGREAL;
>
> rs := r; rs := rl;
> r := rs; r := rl;
> rl := rs; rl := r;
>
> All of above assignment statements should be legal and do the job you
> want. Any other solution trying to convert in the middle of an
> expression would be implementation dependent. For that reason we use
> in our RAMSES (http://www.sysecol.ethz.ch/SimSoftware/RAMSES/) code
> throughout the assignment technique.
>
> Regards,
> Andreas
Hi Carl,
yes I concur with Andreas and gm2 conforms with the above. You can
mix the three types above in expressions but you must explicitly
perform the conversion with VAL. You don't need to use VAL during
assignment (or during non var parameter passing),
regards,
Gaius