Mail Archives: djgpp-workers/2003/08/12/08:17:36
--part1_46.3c4de930.2c6a2e90_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
In a message dated 8/12/2003 3:17:57 AM Eastern Standard Time,
eliz AT elta DOT co DOT il writes:
> Deduction, perhaps mistaken: after the first iteration thru this
> loop:
>
> for (; integer &&p >= startp; ++expcnt)
> {
> tmp = modfl(integer * 0.1L , &integer);
> *p-- = tochar((int)((tmp + .01L) * 10));
> }
>
> the value of `integer' had a .375 as its fraction.
>
A mistake is in multiplying by 0.1 instead of dividing by 10 and taking the
remainder.
--part1_46.3c4de930.2c6a2e90_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<HTML><FONT FACE=3Darial,helvetica><FONT SIZE=3D3 FAMILY=3D"SERIF" FACE=3D"=
Georgia" LANG=3D"0">In a message dated 8/12/2003 3:17:57 AM Eastern Standard=
Time, eliz AT elta DOT co DOT il writes:<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"></FONT><FONT COLOR=3D"#000000"=
style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=3D"A=
rial" LANG=3D"0">Deduction, perhaps mistaken: after the first iteration thru=
this<BR>
loop:<BR>
<BR>
for (; integer &&p >=3D startp; ++expcnt)<BR>
{<BR>
tmp =3D modfl(integer * 0.1L , &integer);<BR>
*p-- =3D tochar((int)((tmp + .01L) * 10));<BR>
}<BR>
<BR>
the value of `integer' had a .375 as its fraction.<BR>
</BLOCKQUOTE><BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3=
FAMILY=3D"SERIF" FACE=3D"Georgia" LANG=3D"0"><BR>
A mistake is in multiplying by 0.1 instead of dividing by 10 and taking the=20=
remainder.</FONT></HTML>
--part1_46.3c4de930.2c6a2e90_boundary--
- Raw text -