HISKP-LQCD/hadron

tex.catwitherror fails for very small (< 1e-20) numbers

Closed this issue · 0 comments

As discussed in the wake of PR #40, tex.catwitherror fails when using very small numbers as value. The error that one gets is this:

Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L,  : 
  invalid 'nsmall' argument

It arises from the use of %f formatting (fixed point) for a number which is too small to be displayed within the number of printed digits:

nsmall: the minimum number of digits to the right of the decimal
          point in formatting real/complex numbers in non-scientific
          formats.  Allowed values are ‘0 <= nsmall <= 20’.

We will need to switch to exponential notation for these cases.