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
// TKK = hours since epoch | |
var window = { | |
TKK: parseInt(new Date().getTime() / 1000 / 60 / 60) | |
}; | |
var t = "a"; | |
var dd = "."; | |
var Vb = "+-a^+6"; | |
var Tb = "+"; | |
var Ub = "+-3^+b+-f"; |
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
// TKK = hours since epoch | |
var window = { | |
TKK: parseInt(new Date().getTime() / 1000 / 60 / 60) | |
}; | |
var t = "a"; | |
var cb = "&"; | |
var mf = "="; | |
var k = ""; | |
var dd = "."; |
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
public BigInteger derangement(int num) { | |
if (num == 0) { | |
return BigInteger.ONE; | |
} | |
BigDecimal sum = BigDecimal.ZERO; | |
for (int i = 0; i <= num; i++) { | |
BigDecimal fact = new BigDecimal(factorial(i)); | |
BigDecimal toAdd = BigDecimal.valueOf(Math.pow(-1, i)).divide(fact, MathContext.DECIMAL128); | |
sum = sum.add(toAdd); |
NewerOlder