[Mono-devel-list] formatting floating point values
Laurent Guerby
guerby at acm.org
Tue Mar 4 16:14:04 EST 2003
On Tue, 2003-03-04 at 21:26, Miguel de Icaza wrote:
> Hello,
>
> > My other comment concerns code duplication in DoubleFormatter.cs and
> > SingleFormatter.cs: I don't think there is any need to have two versions
> > of the same code when the only difference is basically just the default
> > precision. Can't we simple use the DoubleFormatter.cs code with one
> > or two additional parameters?
>
> We have quite a bit of code duplication as well on the integer parsing
> code, but that was because otherwise you end up using the 8-byte long
> operations in loops instead of the cheaper 4-byte longs.
The GNU Ada runtime uses the largest type for all its floating
point format services (on x86 this means 80-bit floats), it all
boils down to the Set_Image_Real routine in:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/s-imgrea.adb?rev=1.4&content-type=text/x-cvsweb-markup
It's heavily commented and not that long,
it would be fun to do the same code in mono
and see how it performs against the current one,
any interest in me trying to do this?
--
Laurent Guerby <guerby at acm.org>
More information about the Mono-devel-list
mailing list