Question: van Vliet: real_width and exp_width
chris hermansen
clhermansen@gmail.com
Thu Mar 12 19:42:34 GMT 2026
Good afternoon everyone,
The RR pp 162-163 defines two integral values L real width and L exp width
as follows:
int L real width =
{ the smallest integral value such that different strings are
produced by conversion of '1.0' and of '1.0 + L small real' using
the pattern d. n(L real width - L 1)d }
1 - S entier(L ln (L small real) / L ln (L 10));
int L exp width=
{ the smallest integral value such that 'L max real' may be
converted without error using the pattern
d. n(L real width - l)d e n(L exp width)d }
1 + S entler (L ln (L ln (L max real) / L ln (L 10)) / L in (L 10));
We could restate these as
int L real width = 1 - S entier (L log10(L small real));
int L exp width = 1 + S entier (L log10(L log10(L max real)));
proc log10 = (L real x) L real:
L ln(x) / L ln(L 10.0);
Conversely, van Vliet defines them as follows:
INT {<} xlx real width =
INT(pseudo49) { the smallest integral value such that different
values yield different strings using the pattern
d.n(xlx real width - 1)d } {>};
INT {<} xlx exp width =
INT(pseudo50) { the smallest integral value such that 'xlx max real'
may be converted without error using the pattern
d.n(xlx real width - 1)d e n(xlx exp width)d } {>};
Two things bother me about van Vliet's version of L real width and L exp
width:
1. he leaves out "produced by conversion of '1.0' and of '1.0 + L small
real'
2. why doesn't he just use the formulas of the RR here?
Anyone have any thoughts?
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260312/d9f04ac2/attachment-0001.htm>
More information about the Algol68
mailing list