mIRC Homepage
Posted By: maroon $calc(math [,digits]) - 23/10/22 10:09 PM
Now that BF mode can return really long fractions, perhaps the issue of a digits parm for $calc() can be addressed again. It is very backwards-compatible for $calc() to have an optional digits parm indicating the rounding precision for the fraction being returned. Unlike prior suggestions wanting the digits parm to allow extra digits, it could be used now to limit the 30-digit fraction without needing to wrap $round() around $calc.

Optionally, the digits parameter could either be something that triggers $calc jumping into Bigfloat mode, or could be something that shortens the result in doubles mode too, where D>6 is ignored because this is not about lengthening the fraction in a non-compatible way.

I doubt there would be much need for something to limit the digit outputs from the trig and log identifiers, since those are most likely to be used as inputs for $calc.
© mIRC Discussion Forums