Fix for issue #20

pull/21/head
Jayson Harshbarger 8 years ago
parent 05e698aba6
commit 08263d4305

@ -3875,6 +3875,7 @@
pi = getPi(Ctor, Ctor.precision, 1),
halfPi = pi.times(HALF);
x = Ctor(x);
x.s = 1;
if (x.lte(halfPi)) {

@ -8,6 +8,10 @@ if (typeof T === 'undefined') require('../setup');
Decimal.rounding = rm;
T.assertEqual(expected, Decimal.cos(n).valueOf());
T.assertEqual(expected, new Decimal(n).cos().valueOf());
var x = new Decimal(n);
x.cos();
T.assertEqual(new Decimal(n).valueOf(), x.valueOf());
}
Decimal.config({
@ -29,6 +33,7 @@ if (typeof T === 'undefined') require('../setup');
t('0.000000065', 18, 4, '0.999999999999997888'); // 0.99999999999999788750000000000074377...
t('14044.44444444444', 10, 4, '0.04549771706');
t('-14044.44444444444', 10, 4, '0.04549771706');
t('5', 8, 5, '0.28366219');
t('6723', 3, 3, '0.999');
t('2.04964', 8, 2, '-0.46075321');

Loading…
Cancel
Save