Sujet : Re: Simple Pascal question
De : johnrreagan (at) *nospam* earthlink.net (John Reagan)
Groupes : comp.os.vmsDate : 04. Aug 2024, 22:53:32
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <0be1217156997a373bd93a731d67a938adb4dc55@i2pn2.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 8/3/2024 1:32 PM, Scott Dorsey wrote:
In article <v8hn3m$3aviu$1@gwaiyur.mb-net.net>,
Uli Bellgardt <UliBellgardtsSpamSink@online.de> wrote:
The value 1.5 should be an f_float value as well:
>
$ type zzz.pas
program z(input,output);
>
var
x : f_float;
This seems very strange to me... Pascal isn't supposed to have such
strong typing, is it? I don't remember ever having to manually coerce
anything. Or is f_float sufficiently different from a normal float?
--scott
Why didn't I do this?
I did think about it, but what about more complicated expression.
x := 1.5 * 1.5;
Is that multiply an IEEE S_float multiply or VAX F_float multiply? Logically, it would have been an IEEE S_float multiply and then converted to VAX F_float. I didn't think it was a problem that needed to be solved.
Pascal was the first to let you mix both kinds of floats in the same module (or so I think). The %F_FLOAT was designed to solve the LIB$WAIT issue when IEEE floating was enabled (yes, I know about the extra argument to LIB$WAIT).