[Info-vax] Roadmap
Arne Vajhøj
arne at vajhoej.dk
Sat Jan 5 21:19:04 EST 2019
On 1/5/2019 8:23 PM, Dave Froble wrote:
> On 1/5/2019 1:48 PM, John Reagan wrote:
>> The format of the REAL_SIZE qualifier is as follows:
>>
>> /REAL_SIZE={SINGLE}
>> {DOUBLE}
>> {GFLOAT}
>> {SFLOAT}
>> {TFLOAT}
>> {XFLOAT}
>> So Dave's "OPTION SIZE = ( INTEGER WORD , REAL DOUBLE )" which was
>> originally used to say "I want extra precision on my REALs" locks into
>> you Dfloat on Itanium.
>> What a horrible design decision. So people who didn't say anything on
>> Itanium, get fast Sfloat but the moment you want more precision and
>> blindly say "REAL DOUBLE", you get your extra precision (but no extra
>> range) and a performance hit.
> Maybe the D_FLOAT isn't so bad, if you're not doing a lot of work with it.
Basic is probably not a favorite language for number crunchers, so
most likely the practical impact is minimal.
It is possible though to create an example showing a difference:
$ type dbl.bas
option type = explicit
declare long constant n = 10000000
external long function pas$clock2
dim real x(n)
declare long j, i, t1, t2
t1 = pas$clock2()
for j = 1 to 10
x(1) = 1.0
for i = 2 to n
x(i) = (x(i - 1) * 2 + 2) / 2
next i
next j
t2 = pas$clock2()
print using "#### (##########.#)"; (t2 - t1); x(n)
end
$ bas/real=double dbl
$ lin dbl
$ r dbl
5810 ( 10000000.0)
$ bas/real=tfloat dbl
$ lin dbl
$ r dbl
3000 ( 10000000.0)
(forgive me for any basic Basic blunders - it is not a language
I am using)
Arne
More information about the Info-vax
mailing list