Adam Cameron
try {
radix = 36
result = CreateObject("java", "java.math.BigInteger").init("42", radix)
writeDump([result, radix.getClass().getName()]) // 146, java.lang.Double
} catch (any e) {
writeDump([e.message, e.detail])
}
What I'm wondering is... given radix
is a Double, and BigInteger doesn't implement a constructor that takes a Double for the radix (see https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/math/BigInteger.html), how this code runs, rather than giving something along the lines of "no suitable constructor found for BigInteger(String,Double)"dswitzer
03/15/2022, 3:29 PMbdw429s
03/15/2022, 7:15 PMradix
variable, not the result
variable.bdw429s
03/15/2022, 7:15 PMCFSCRIPT-REPL: CreateObject("java", "java.math.BigInteger").init(2,36).getClass().getName()
java.math.BigInteger
bdw429s
03/15/2022, 7:15 PMradix = 36
☝️ But this is going to be a DoubleAdam Cameron
Adam Cameron
bdw429s
03/15/2022, 7:16 PMbdw429s
03/15/2022, 7:16 PMbdw429s
03/15/2022, 7:16 PMAdam Cameron
bdw429s
03/15/2022, 7:16 PMAdam Cameron
Adam Cameron
bdw429s
03/15/2022, 7:17 PMAdam Cameron
bdw429s
03/15/2022, 7:17 PMbdw429s
03/15/2022, 7:18 PMbdw429s
03/15/2022, 7:18 PMAdam Cameron
Adam Cameron
Adam Cameron
David Rogers
03/15/2022, 7:21 PMAdam Cameron
David Rogers
03/15/2022, 7:21 PMAdam Cameron
Adam Cameron
David Rogers
03/15/2022, 7:26 PM