[Aldor-l] Re: Aldor program: Assistance requested.
Christian Aistleitner
tmgisi at gmx.at
Mon Oct 3 07:25:05 EDT 2005
Hello,
although this thread is old, I have some comments to make.
> let me post your question to aldor-l since there might be others who
> could help better than me.
I guess it is best to discuss ALL aldor related problems in public. It
might save time for others.
> The program is attached (matex.as).
>
> It compiles on my Debian Linux machine without a problem.
>
> On my machine the output starts with
>
> vector [1.20000004,2.08999991e+1,1.47000002e+1]
> vector [-1.10000002,4.80000019,-3.70000004]
> vector [1.00029993e+3,-2.5,7.5]
>
> and
>
> [...]
>
> in case of DoubleFloat.
>
> So we see some rounding error which I find quite annoying, but it comes
> from the output routine not the internal representation.
I will focus on the SingleFloat case, as a suppose the same observations
apply to DoubleFloat.
I can confirm the output on my sosytem.
The output is faulty -- I admit that. The answer however probably
misleading.
Take for example 20.9 (first vector, second slot)
Its internal representation is 109576619*2^(-19) in IEEE 32-bit float.
This evaluates to
20.8999996185302734375.
So I cannot see how this can be rounded to
2.08999991e+1
which is Aldor's output.
However, I would consider output like
2.08999996e+1 or
2.089999962e+1
correct. Obviously, an output like
20.9
is desired. But this is a problem of setting the printed precision. Aldor
does currently not allow this. Period. (Although a sad peried, when
comparing to output functions like printf in C).
However, I am curious which number format Aldor is using internally. I
suppose IEEE 32bit floats. However, then the output routine is a bit fishy.
--
Best regards,
Christian
More information about the Aldor-l
mailing list