mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
Merge pull request #3298 from nycdotnet/master
Add support for big.js v3.0.0
This commit is contained in:
@@ -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
|
||||
}
|
||||
Vendored
+3
@@ -42,6 +42,9 @@ declare module BigJsLibrary {
|
||||
(value: string): BigJS;
|
||||
/** A decimal value. */
|
||||
(value: BigJS): BigJS;
|
||||
|
||||
/** A decimal value. */
|
||||
(): BigJS;
|
||||
}
|
||||
|
||||
/** BigJS instance methods */
|
||||
|
||||
Reference in New Issue
Block a user