Hello, currently the precision parameter means the number of digitis after the decimal point but sometimes one want the number of digits to be the precision.
For example, the number 12.345 (1.2345e1) with three digits precision means 12.3 (1.23e1) but the number 1.2345 with three digits precision means 1.23 (1.23e0), one could call it a relative precision. It simple terms, one turns the number in scientific notation then take n digits.
In order to not break with older versions, I suggest to accept a new parameter like digits=3 (mutally exclusive with precision, ie. raises an error if both parameters are given) or def a new function where precision has a diferent meaning.
Hello, currently the
precisionparameter means the number of digitis after the decimal point but sometimes one want the number of digits to be the precision.For example, the number 12.345 (1.2345e1) with three digits precision means 12.3 (1.23e1) but the number 1.2345 with three digits precision means 1.23 (1.23e0), one could call it a relative precision. It simple terms, one turns the number in scientific notation then take
ndigits.In order to not break with older versions, I suggest to accept a new parameter like
digits=3(mutally exclusive with precision, ie. raises an error if both parameters are given) or def a new function where precision has a diferent meaning.