This is a multi-part message in MIME format.
--------------010602030409000209010900
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
The most user-friendly solution would be do it "right" without forcing
the user to endure poor performance. Making floating-point formatting
invariant by default solves many problems, there is no reason to make it
optional.
There is public-domain C code that formats floating-point values as the
shortest string that parses back to the exact same value. The only
thing that needs to happen is to interface Ruby with that code.
If you make the assumption that Ruby programmers don't care about
floating point I/O performance, you will quickly surprised. :)
Eero Saynatkari wrote:
> Excerpts from Yukihiro Matsumoto's message of Mon Mar 02 12:46:27 +0200 2009:
>
>> But replacing float by bigdecimal hinders calculation performance a
>> lot. I don't think it's acceptable.
>>
>
> The most user-friendly solution would likely be to go BigDecimal
> by default and offer either a command-line switch or some pseudo-
> require "fastdecimal" to default to Floats instead (although the
> latter would need logic for handling files already loaded.) It
> would need a toggle in the parser, presumably, presenting a fairly
> minor overhead? I would imagine most Ruby programs do not depend
> on floating point performance. A configuration option for the
> same works too, of course, but not needing a specialized build
> is probably a good thing.
>
> If this seems like a reasonable way to go, it should not be too
> difficult for someone patch it for you.
>
>
> --
> Magic is insufficiently advanced technology.
>
>
--------------010602030409000209010900
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content ext/html;charset F-8" http-equiv
ontent-Type">
</head>
<body bgcolor ffffff" text 000000">
The most user-friendly solution would be do it "right" without forcing
the user to endure poor performance. Making floating-point formatting
invariant by default solves many problems, there is no reason to make
it optional.<br>
<br>
There is public-domain C code that formats floating-point values as the
shortest string that parses back to the exact same value. The only
thing that needs to happen is to interface Ruby with that code.<br>
<br>
If you make the assumption that Ruby programmers don't care about
floating point I/O performance, you will quickly surprised. :)<br>
<br>
Eero Saynatkari wrote:
<blockquote cite id:1236001456-sup-1865 / meow.kittensoft.org"
type
ite">
<pre wrap >Excerpts from Yukihiro Matsumoto's message of Mon Mar 02 12:46:27 +0200 2009:
</pre>
<blockquote type
ite">
<pre wrap >But replacing float by bigdecimal hinders calculation performance a
lot. I don't think it's acceptable.
</pre>
</blockquote>
<pre wrap ><!---->
The most user-friendly solution would likely be to go BigDecimal
by default and offer either a command-line switch or some pseudo-
require "fastdecimal" to default to Floats instead (although the
latter would need logic for handling files already loaded.) It
would need a toggle in the parser, presumably, presenting a fairly
minor overhead? I would imagine most Ruby programs do not depend
on floating point performance. A configuration option for the
same works too, of course, but not needing a specialized build
is probably a good thing.
If this seems like a reasonable way to go, it should not be too
difficult for someone patch it for you.
--
Magic is insufficiently advanced technology.
</pre>
</blockquote>
<br>
</body>
</html>
--------------010602030409000209010900--