Re: Floating point arithmetic support in DCL
mckinneyj_at_cpva.saic.com
Date: 12/31/03
- Next message: Larry Kilgallen: "RE: Floating point arithmetic support in DCL"
- Previous message: Rob Brooks: "Re: Rally VAX to Alpha Migration"
- Next in thread: JF Mezei: "Re: Floating point arithmetic support in DCL"
- Reply: JF Mezei: "Re: Floating point arithmetic support in DCL"
- Maybe reply: David J. Dachtera: "Re: Floating point arithmetic support in DCL"
- Maybe reply: David J. Dachtera: "Re: Floating point arithmetic support in DCL"
- Maybe reply: Richard B. Gilbert: "Re: Floating point arithmetic support in DCL"
- Maybe reply: Bob Koehler: "Re: Floating point arithmetic support in DCL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 03 11:24:26 PST
In article <jyUbuT+3w646@eisner.encompasserve.org>,
briggs@encompasserve.org writes:
> In article <3FF24171.E9EDF72C@NeOaSrPtAhMlNiOnWk.net>, "David J. Dachtera" <djesys.nospam@NeOaSrPtAhMlNiOnWk.net> writes:
>> Charlie Hammond wrote:
>>>
>>> In article <3FF0F788.7862539F@NeOaSrPtAhMlNiOnWk.net>,
>>> "David J. Dachtera" <djesys.nospam@NeOaSrPtAhMlNiOnWk.net> writes:
>>> >Charlie Hammond wrote:
>>> ..
>>> >> Likewise if a5 = 5 and a4 = 4, then if a5 / a4 .eq. 1.25 and not just 1,
>>> >> the same problem exists.
>>> >
>>> >Rather depends on whether A5 and A4 were "declared" (implicitly or
>>> >explicitly) as integer or float.
>>> ..
>>>
>>> Exactly the problem.
>>>
>>> I "A = 5 / 4" results in an implicit declaration of A as float,
>>> then existing code breaks.
>>
>> 5 and 4 are both integer expressions. An integer result is reasonable to
>> expect. If A had been previously declared as float (by any means), the
>> potential for trouble may exist.
>
> But in DCL, symbols do not have declared data types. They take on
> the data type of the value that is assigned to them. If A had previously
> contained the value 3.1E+00 and been of type float then after the
> assignment it should contain the value 1 and be of type integer.
>
> i.e. the previous contents of A and data type of A are completely
> irrelevant.
>
> John Briggs
I agree with John.
Consider this - introduce a new assignment mechanism to declare
floating point data types - say, ".=" and ".==". This should protect
older code from failure. So, then we have
$ A = 5/4 ! A=1
$ A := 5/4 ! A="5/4"
$ A .= 5/4 ! A=1.25
The assignment operator always determines the data type in a way that
is independent of the datatypes and operations that appear on the the
right side of the assignment operator.
-- - Jim
- Next message: Larry Kilgallen: "RE: Floating point arithmetic support in DCL"
- Previous message: Rob Brooks: "Re: Rally VAX to Alpha Migration"
- Next in thread: JF Mezei: "Re: Floating point arithmetic support in DCL"
- Reply: JF Mezei: "Re: Floating point arithmetic support in DCL"
- Maybe reply: David J. Dachtera: "Re: Floating point arithmetic support in DCL"
- Maybe reply: David J. Dachtera: "Re: Floating point arithmetic support in DCL"
- Maybe reply: Richard B. Gilbert: "Re: Floating point arithmetic support in DCL"
- Maybe reply: Bob Koehler: "Re: Floating point arithmetic support in DCL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|