[Info-vax] Python for x86?
Arne Vajhøj
arne at vajhoej.dk
Wed May 10 10:00:08 EDT 2023
On 5/9/2023 11:32 PM, Dave Froble wrote:
> On 5/9/2023 6:38 PM, Chris Townley wrote:
>> Arne posted a link to the code before, but the relevant bits are:
>>
>> Arne's version:
>>
>> sub testfp(integer xscale)
>>
>> declare integer constant NFP = 1000
>> declare integer constant N = 1000000
>> declare integer i, j, nfpscale
>> declare double sum
> ^^^^^^^^^^^^^^^^^^^^
>
> I'm thinking that is the problem. There will be many conversions.
sum has to be FP in testfp.
The problem was in testint.
>> for j = 1 to N
>> sum = ((sum + 1) * 2 + 1) / 2
> "1", "2", "1", and "2" are all FP
so:
>> for j = 1 to N
>> sum = ((sum + 1%) * 2% + 1%) / 2%
>> next j
And that was the problem.
The assumption that 1 and 2 were integer literals.
Arne
More information about the Info-vax
mailing list