Code example for BigInteger

Methods: negate, signum

0
                } else { 
                    return model;
                } 
            } else if (num instanceof BigInteger) {
                BigInteger n = (BigInteger) num;
                if (n.signum() < 0) {
                    return new SimpleNumber(n.negate());
                } else { 
                    return model;
                } 
            } else { 
                throw new _TemplateModelException(new Object[] {
                        "Unsupported number class: ", num.getClass() });
            }             
        } 
    } 
     
    static class is_nanBI extends NumberBuiltIn { 
        TemplateModel calculateResult(Number num, TemplateModel model) throws TemplateModelException {
            return NumberUtil.isNaN(num) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
        }