Merge pull request #3298 from nycdotnet/master

Add support for big.js v3.0.0
This commit is contained in:
Masahiro Wakame
2014-12-11 23:12:01 +09:00
2 changed files with 20 additions and 0 deletions
+17
View File
@@ -230,4 +230,21 @@ function propertiesTest3() {
y.c // '0' [0].toString()
y.e // 0
y.s // -1
}
// see http://mikemcl.github.io/big.js/#faq
// "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?"
function testMultipleConstructors() {
var Big10 = Big();
// Set the decimal places of division operations for each constructor.
Big.DP = 3;
Big10.DP = 10;
var x = Big(5);
var y = Big10(5);
x.div(3) // 1.667
y.div(3) // 1.6666666667
}
+3
View File
@@ -42,6 +42,9 @@ declare module BigJsLibrary {
(value: string): BigJS;
/** A decimal value. */
(value: BigJS): BigJS;
/** A decimal value. */
(): BigJS;
}
/** BigJS instance methods */