[PTLsim-devel] Bug while printing floating points rvn 225
abhishek
Thu Feb 28 08:42:51 EST 2008
Hi,
I'm providing a quick solution for the problem, thought it could be
useful for all. The attached diff file can be patched. Note the changes
are over rvn 228 (the patched files haven't changed from rvn 225, so u
could apply it on rvn 225 also).
regards,
abhishek
On Mon, 2008-02-25 at 01:01 +0100, abhishek wrote:
> Hi,
>
> float temp = 2.0069;
> cerr << temp, endl, flush;
>
> it prints as 2.699342384
>
> Not the two zeroes after decimal place are missing. The format_float
> function in klibc.cpp doesn't take care of the case when there zeroes
> immediately after the decimal place.
>
> Also, in format_number functions in superstl.cpp the following lines
> doesn't make much sense.
>
> if (i > precision)
> precision = i;
> As a result some junk characters are printed.
>
> regards,
> abhishek
>
> _______________________________________________
> PTLsim-devel mailing list
> PTLsim-devel at ptlsim.org
> https://ptlsim.org/mailman/listinfo/ptlsim-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptlsim-fp-print-bug.diff
Type: text/x-patch
Size: 1119 bytes
Desc: not available
Url : https://ptlsim.org/pipermail/ptlsim-devel/attachments/20080228/0302e6c0/attachment.diff
More information about the PTLsim-devel mailing list