Project

General

Profile

Bug #4510 ยป float-pow.patch

Patch against trunk to replace a counting loop with a call to pow(3) - regularfry (Alex Young), 03/18/2011 10:24 PM

View differences:

numeric.c
{
VALUE nd;
double number, f;
int ndigits = 0, i;
int ndigits = 0;
long val;
if (argc > 0 && rb_scan_args(argc, argv, "01", &nd) == 1) {
ndigits = NUM2INT(nd);
}
number = RFLOAT_VALUE(num);
f = 1.0;
i = abs(ndigits);
while (--i >= 0)
f = f*10.0;
f = pow(10,abs(ndigits));
if (isinf(f)) {
if (ndigits < 0) number = 0;
    (1-1/1)