-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
140 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
<html> | ||
<!--Remember to change /v0.0-beta0.0/ to the version you are targeting --> | ||
<bascript src="https://cdn.rawgit.com/osofem/BigArith.js/v0.0-beta0.0/BigArith.js"></bascript> | ||
<script src="../BigArith.js"></script> | ||
<bascript src="https://cdn.rawgit.com/osofem/bigarith.js/v0.0-beta0.0/bigarith.js"></bascript> | ||
<script src="../bigarith.js"></script> | ||
<bascript src="https://cdn.rawgit.com/osofem/assert.js/v0.0-beta0.0/assert.js"></bascript> | ||
<script src="../../assert/assert.js"></script> | ||
<script> | ||
var ba = new BigArith(2); | ||
//max | ||
assertDeepEqual(ba.max("2"), new BigArith("2")); | ||
assertDeepEqual(ba.max(-2), new BigArith("2")); | ||
assertDeepEqual(ba.max("4", 8), new BigArith("8")); | ||
assertDeepEqual(ba.max(-2, -3, -10), new BigArith("2")); | ||
assertDeepEqual(ba.max("two"), new BigArith("2")); | ||
assertDeepEqual(ba.max("2.0"), new BigArith("2")); | ||
assertDeepEqual(ba.max("negative two"), new BigArith("2")); | ||
assertDeepEqual(ba.max("negative two", "3.0", 987), new BigArith("987")); | ||
assertDeepEqual(ba.max("-2"), new BigArith("2")); | ||
assertDeepEqual(ba.max(), new BigArith("2")); | ||
|
||
ba = new BigArith(-2); | ||
assertDeepEqual(ba.max(-4), new BigArith("-2")); | ||
|
||
ba = new BigArith(NaN); | ||
assertIsNaN(ba.max("4")); | ||
|
||
//Or | ||
assertDeepEqual(BigArith.max("-165.8987", "165.898700000000000000000"), new BigArith("165.8987")); | ||
assertDeepEqual(BigArith.max("0.123568123", "-0.03455893"), new BigArith("0.123568123")); | ||
assertDeepEqual(BigArith.max("+0.03455893", "0.123568123"), new BigArith("0.123568123")); | ||
assertDeepEqual(BigArith.max("459", "-165.8987", "165.898700000000000000000", "200", "467"), new BigArith("467")); | ||
assertDeepEqual(BigArith.max("99", "0.123568123", "-0.03455893"), new BigArith("99")); | ||
assertDeepEqual(BigArith.max("45", "4590", "+0.03455893", "0.123568123"), new BigArith("4590")); | ||
assertDeepEqual(BigArith.max(), new BigArith("0")); | ||
|
||
assertIsNaN(BigArith.max("4", NaN)); | ||
assertIsNaN(BigArith.max(NaN, "4")); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
<html> | ||
<!--Remember to change /v0.0-beta0.0/ to the version you are targeting --> | ||
<bascript src="https://cdn.rawgit.com/osofem/BigArith.js/v0.0-beta0.0/BigArith.js"></bascript> | ||
<script src="../BigArith.js"></script> | ||
<bascript src="https://cdn.rawgit.com/osofem/assert.js/v0.0-beta0.0/assert.js"></bascript> | ||
<bascript src="https://cdn.rawgit.com/osofem/bigarith.js/v0.0-beta0.0/bigarith.js"></bascript> | ||
<script src="../bigarith.js"></script> | ||
<bascript src="https://cdn.rawgit.com/osofem/assert.js/v0.0-beta0.2/assert.js"></bascript> | ||
<script src="../../assert/assert.js"></script> | ||
<script> | ||
var ba = new BigArith(2); | ||
//min | ||
assertDeepEqual(ba.min("2"), new BigArith("2")); | ||
assertDeepEqual(ba.min(-2), new BigArith("-2")); | ||
assertDeepEqual(ba.min("two"), new BigArith("2")); | ||
assertDeepEqual(ba.min("2", 45, -98), new BigArith("-98")); | ||
assertDeepEqual(ba.min(-2, -90), new BigArith("-90")); | ||
assertDeepEqual(ba.min("one"), new BigArith("1")); | ||
assertDeepEqual(ba.min("2.0"), new BigArith("2")); | ||
assertDeepEqual(ba.min("negative two"), new BigArith("-2")); | ||
assertDeepEqual(ba.min("negative two", -89, -234, 788), new BigArith("-234")); | ||
assertDeepEqual(ba.min("-2"), new BigArith("-2")); | ||
assertDeepEqual(ba.min(), new BigArith("2")); | ||
|
||
ba = new BigArith(NaN); | ||
assertIsNaN(ba.min(-7)); | ||
|
||
//Or | ||
assertDeepEqual(BigArith.min("-165.8987", "165.898700000000000000000"), new BigArith("-165.8987")); | ||
assertDeepEqual(BigArith.min("0.123568123", "-0.03455893"), new BigArith("-0.03455893")); | ||
assertDeepEqual(BigArith.min("+0.03455893", "0.123568123"), new BigArith("0.03455893")); | ||
assertDeepEqual(BigArith.min("-165.8987", "165.898700000000000000000", "345"), new BigArith("-165.8987")); | ||
assertDeepEqual(BigArith.min("0.123568123", "-0.03455893", "-0.000989"), new BigArith("-0.03455893")); | ||
assertDeepEqual(BigArith.min("0.93455893", "-0.123568123", "45.89"), new BigArith("-0.123568123")); | ||
|
||
assertIsNaN(BigArith.min("0.93455893", "-0.123568123", "45.89", NaN)); | ||
assertIsNaN(BigArith.min(NaN)); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<html> | ||
<!--Remember to change /v0.0-beta0.0/ to the version you are targeting --> | ||
<xscript src="https://cdn.rawgit.com/osofem/BigArith.js/v0.0-beta0.0/BigArith.js"></xscript> | ||
<script src="../BigArith.js"></script> | ||
<xscript src="https://cdn.rawgit.com/osofem/bigarith.js/v0.0-beta0.0/bigarith.js"></xscript> | ||
<script src="../bigarith.js"></script> | ||
<xscript src="https://cdn.rawgit.com/osofem/assert.js/v0.0-beta0.0/assert.js"></xscript> | ||
<script src="../../assert/assert.js"></script> | ||
<script> | ||
console.log(BigArith.randomInt("0", 1000)); //Any number between 0 and 1000 | ||
console.log(BigArith.randomInt("one", "one million")); //Any number between 1 and 1000000 | ||
console.log(BigArith.randomInt("one million", "three trillion")); //Any number between 1000000 and 1000000000000 | ||
console.log(BigArith.randomInt(1e3, new BigArith("1000"))); //Will always display 1000 | ||
|
||
console.log(BigArith.randomInt("1.9","2.1")); | ||
console.log(BigArith.randomInt("9","1")); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.