[#7653] parse.y: literal strings for tokens — Robin Stocker <robin@...>
Hi,
Hi,
Yukihiro Matsumoto wrote:
[#7674] Re: [PATCH] parse.y: literal strings for tokens — ville.mattila@...
ville.mattila@stonesoft.com wrote:
Hi again,
Hi,
[#7692] Socket Documentation commit ? — zdennis <zdennis@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#7708] Bug in libsnmp-ruby1.8 — Hadmut Danisch <hadmut@...>
Hi,
On Apr 11, 2006, at 6:23 AM, Hadmut Danisch wrote:
On 2006-04-12 02:04:32 +0900, Eric Hodel wrote:
On Apr 11, 2006, at 10:20 AM, Marcus Rueckert wrote:
[#7721] Ruby mentor in Googe's Summer of Code — "Evan Phoenix" <evan@...>
We missed out on it last year, so lets this year try to get ruby
[#7725] readpartial not working on ARM — Joel VanderWerf <vjoel@...>
[#7727] Stack trace doesn't include class — noreply@...
Bugs item #4151, was opened at 2006-04-17 23:10
On Apr 17, 2006, at 1:11 PM, noreply@rubyforge.org wrote:
On Wed, 19 Apr 2006, Eric Hodel wrote:
Hi --
[#7729] xmlrpc and charset=utf-8 — "Phil Tomson" <rubyfan@...>
I'm needed to interact with an XMLRPC server written using the
>>>>> On Sun, 18 Jun 2006 12:00:19 +0900
I first sent this from the wrong email account, so if that post somehow makes
On 6/19/06, Sean Russell <ser@germane-software.com> wrote:
[#7738] RDoc patches for GetoptLong — mathew <meta@...>
I added RDoc documentation to GetoptLong. The patches are attached. As
[#7744] Coverity Scan — "Pat Eyler" <rubypate@...>
I don't know if anyone else has signed up for access to the coverity
[#7765] possible defect in array.c — "Pat Eyler" <rubypate@...>
This one may be a false positive, I'm not sure. If it is, I'll happily mark
On 4/25/06, Pat Eyler <rubypate@gmail.com> wrote:
[#7770] Re: possible defect in array.c — "Brown, Warren" <warrenbrown@...>
> rb_range_beg_len (in range.c) does set beg and len.
On 4/26/06, Brown, Warren <warrenbrown@aquire.com> wrote:
On 4/26/06, Pat Eyler <rubypate@gmail.com> wrote:
On 4/26/06, Jacob Fugal <lukfugl@gmail.com> wrote:
On Thu, Apr 27, 2006 at 01:15:24AM +0900, Pat Eyler wrote:
Hi,
On Thu, Apr 27, 2006 at 09:41:00AM +0900, Nobuyoshi Nakada wrote:
[#7799] Patch: code-cleanup (k&r style) — Stefan Huehner <stefan@...>
Hi,
Hi,
Re: [ ruby-Bugs-4284 ] Float near Float::MIN
Hi,
In message "Re: [ ruby-Bugs-4284 ] Float near Float::MIN"
on Fri, 28 Apr 2006 04:14:47 +0900, noreply@rubyforge.org writes:
|3. comment:
|since 2.2250738585072e-308 is a legitimate Floating point number, and meant to be the smallest above zero, I would expect 1e-307, which is more than that to be working correctly. But I get:
|- a weird warning which should not occur
|- a wrong output which is off about by a factor of 10**16
|- a output which should not be a legitimate Float, because it is between 0 and Float::MIN
The built-in strtod() function cut off exponent digits too early.
This is a patch to fix this.
matz.
--- util.c 17 Feb 2006 02:21:35 -0000 1.50
+++ util.c 28 Apr 2006 01:56:38 -0000
@@ -17,2 +17,3 @@
#include <errno.h>
+#include <math.h>
@@ -666,18 +667,4 @@ ruby_getcwd(void)
-#define TRUE 1
-#define FALSE 0
-
static int MDMINEXPT = -323;
-static int MDMAXEXPT = 309;
-static double powersOf10[] = { /* Table giving binary powers of 10. Entry */
- 10.0, /* is 10^2^i. Used to convert decimal */
- 100.0, /* exponents into floating-point numbers. */
- 1.0e4,
- 1.0e8,
- 1.0e16,
- 1.0e32,
- 1.0e64,
- 1.0e128,
- 1.0e256
-};
+static int MDMAXEXPT = 309;
@@ -722,4 +709,4 @@ ruby_strtod(
{
- int sign, expSign = FALSE;
- double fraction, dblExp, *d;
+ int sign, expSign = Qfalse;
+ double fraction = 0.0, dblExp;
register const char *p;
@@ -737,4 +724,4 @@ ruby_strtod(
int mantSize = 0; /* Number of digits in mantissa. */
- int hasPoint = FALSE; /* Decimal point exists. */
- int hasDigit = FALSE; /* I or F exists. */
+ int hasPoint = Qfalse; /* Decimal point exists. */
+ int hasDigit = Qfalse; /* I or F exists. */
const char *pMant; /* Temporarily holds location of mantissa
@@ -754,3 +741,3 @@ ruby_strtod(
if (*p == '-') {
- sign = TRUE;
+ sign = Qtrue;
p += 1;
@@ -761,3 +748,3 @@ ruby_strtod(
}
- sign = FALSE;
+ sign = Qfalse;
}
@@ -774,3 +761,3 @@ ruby_strtod(
}
- hasPoint = TRUE;
+ hasPoint = Qtrue;
}
@@ -787,3 +774,3 @@ ruby_strtod(
}
- hasDigit = TRUE;
+ hasDigit = Qtrue;
}
@@ -811,3 +798,3 @@ ruby_strtod(
else {
- int frac1, frac2;
+ double frac1, frac2;
frac1 = 0;
@@ -841,3 +828,3 @@ ruby_strtod(
if (*p == '-') {
- expSign = TRUE;
+ expSign = Qtrue;
p += 1;
@@ -848,3 +835,3 @@ ruby_strtod(
}
- expSign = FALSE;
+ expSign = Qfalse;
}
@@ -875,34 +862,35 @@ ruby_strtod(
- if (exp >= MDMAXEXPT - 18) {
- exp = MDMAXEXPT;
+ if (exp >= MDMAXEXPT) {
errno = ERANGE;
+ return HUGE_VAL * (sign ? -1.0 : 1.0);
}
- else if (exp < MDMINEXPT + 18) {
- exp = MDMINEXPT;
+ else if (exp < MDMINEXPT) {
errno = ERANGE;
+ return 0.0 * (sign ? -1.0 : 1.0);
}
- fracExp = exp;
- exp += 9;
- if (exp < 0) {
- expSign = TRUE;
- exp = -exp;
- }
- else {
- expSign = FALSE;
- }
- dblExp = 1.0;
- for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
- if (exp & 01) {
- dblExp *= *d;
+ if (frac1 > 0) {
+ fracExp = exp;
+ exp += 9;
+ if (exp < 0) {
+ expSign = Qtrue;
+ exp = -exp;
}
+ else {
+ expSign = Qfalse;
+ }
+ dblExp = 10.0;
+ while (exp) {
+ if (exp & 1) {
+ if (expSign)
+ frac1 /= dblExp;
+ else
+ frac1 *= dblExp;
+ }
+ exp >>= 1;
+ dblExp *= dblExp;
+ }
+ fraction = frac1;
}
- if (expSign) {
- fraction = frac1 / dblExp;
- }
- else {
- fraction = frac1 * dblExp;
- }
- exp = fracExp;
if (exp < 0) {
- expSign = TRUE;
+ expSign = Qtrue;
exp = -exp;
@@ -910,16 +898,17 @@ ruby_strtod(
else {
- expSign = FALSE;
+ expSign = Qfalse;
}
- dblExp = 1.0;
- for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
- if (exp & 01) {
- dblExp *= *d;
+ dblExp = 10.0;
+ while (exp)
+ {
+ if (exp & 1) {
+ if (expSign)
+ frac2 /= dblExp;
+ else
+ frac2 *= dblExp;
}
+ exp >>= 1;
+ dblExp *= dblExp;
}
- if (expSign) {
- fraction += frac2 / dblExp;
- }
- else {
- fraction += frac2 * dblExp;
- }
+ fraction += frac2;
}