[Info-vax] Where is EISNER:: and who funds it?

Arne Vajhøj arne at vajhoej.dk
Sun Dec 26 16:45:42 EST 2021


On 12/26/2021 5:48 AM, Simon Clubley wrote:
> On 2021-12-25, Dave Froble <davef at tsoft-inc.com> wrote:
>> As far as that goes, so is Fahrenheit with either.  It's just a multiplier and
>> an offset.
>>
>> A couple of lines from a simple VB program I have:
>>
>>       C = (F - 32) * 5 / 9
>>       F = C * 9 / 5 + 32
> 
> I looked at the above two statements and basically went "eek!" at
> all the implicit type conversions potentially going on above. :-)
> 
> Does VB do the right thing above or do variables F and C get
> type converted to an integer (with loss of information) before
> the above calculations are done ?
> 
> Just curious. (In situations like that, I would have written the
> integers with a decimal component, so 32 would become 32.0 for example.)

VMS Basic behaves like most other languages.

If the input variable is integer then it does integer math.

If the input variable is floating point then it does floating point math.

And it produces expected result if input variable and output
variable are same type.

Only if input is integer and output is floating point it is
necessary to do something to change the math from integer math
to floating point math.

Arne







More information about the Info-vax mailing list