You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GlobalCode/AltNum/AltNumDebug.hpp
+46-46Lines changed: 46 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -276,52 +276,52 @@ namespace BlazesRusDebug
276
276
//if (value <= 0) {}else//Error if equal or less than 0
277
277
if (value==MediumDec::One)
278
278
return MediumDec::Zero;
279
-
if (value.IntValue==0)//Threshold between 0 and 2 based on Taylor code series from https://stackoverflow.com/questions/26820871/c-program-which-calculates-ln-for-a-given-variable-x-without-using-any-ready-f
280
-
{
281
-
double fthreshold = 0.000000005;
282
-
double fbase = fvalue - 1; // Base of the numerator; exponent will be explicit
283
-
int den = 2; // Denominator of the nth term
284
-
bool posSign = true; // Used to swap the sign of each term
285
-
double fterm = fbase; // First term
286
-
double fprev; // Previous sum
287
-
double fresult = fterm; // Kick it off
288
-
doublefAddRes;
289
-
290
-
MediumDec threshold = MediumDec::FiveMillionth;
291
-
MediumDec base = value - 1; // Base of the numerator; exponent will be explicit
292
-
MediumDec term = base; // First term
293
-
MediumDec prev; // Previous sum
294
-
MediumDec result = term; // Kick it off
295
-
MediumDec AddRes;
296
-
297
-
do
298
-
{
299
-
posSign = !posSign;
300
-
301
-
fterm *= fbase;
302
-
term *= base;
303
-
304
-
fprev = fresult;
305
-
prev = result;
306
-
307
-
fAddRes = fterm / den;
308
-
AddRes = term / den;
309
-
310
-
if (posSign)
311
-
fresult += fAddRes;
312
-
else
313
-
fresult -= fAddRes;
314
-
if (posSign)
315
-
result += term / den;
316
-
else
317
-
result -= term / den;
318
-
319
-
den++;
320
-
} while (abs(fprev - fresult) > fthreshold);
321
-
322
-
return result;
323
-
}
324
-
elseif(value.IntValue==1)
279
+
//if (value.IntValue==0)//Threshold between 0 and 2 based on Taylor code series from https://stackoverflow.com/questions/26820871/c-program-which-calculates-ln-for-a-given-variable-x-without-using-any-ready-f
280
+
//{
281
+
// double fthreshold = 0.000000005;
282
+
// double fbase = fvalue - 1; // Base of the numerator; exponent will be explicit
283
+
// int den = 2; // Denominator of the nth term
284
+
// bool posSign = true; // Used to swap the sign of each term
0 commit comments