bool HiseJavascriptEngine::RootObject::isNumeric(const var& v) noexcept { return v.isInt() || v.isDouble() || v.isInt64() || v.isBool(); }
/** Returns the bigger number. */ var max(var first, var second) { return (first.isInt() && second.isInt()) ? var(jmax((int)first, (int)second)) : var(jmax((double)first, (double)second)); }
/** Limits the value to the given range. */ var range(var value, var lowerLimit, var upperLimit) { return value.isInt() ? var(jlimit<int>(lowerLimit, upperLimit, value)) : var(jlimit<double>(lowerLimit, upperLimit, value)); }
/** Returns the sign of the value. */ var sign(var value) { return value.isInt() ? var(sign_((int)value)) : var(sign_((double)value)); }
/** Rounds the value to the next integer. */ var round(var value) { return value.isInt() ? var(roundToInt((int)value)) : var(roundToInt((double)value)); }
/** Returns the absolute (unsigned) value. */ var abs(var value) { return value.isInt() ? var(std::abs((int)value)) : var(std::abs((double)value)); }