On Sun, Sep 01, 2019 at 03:12:51PM -0700, John Hardin wrote: > On Sun, 1 Sep 2019, Henrik K wrote: > > >On Sun, Sep 01, 2019 at 09:36:55AM -0700, John Hardin wrote: > >>On Sun, 1 Sep 2019, Henrik K wrote: > >> > >>>On Sat, Aug 31, 2019 at 12:08:31PM -0700, John Hardin wrote: > >>>>All: > >>>> > >>>>I'd like to add "use POSIX" to some code used in ruleqa - anybody know > >>>>whether that would break ruleqa because that module isn't installed? > >>> > >>>It's core module, so it's not possible to be missing. > >> > >>Thanks. I did a quick search but didn't find any definitive information on > >>that detail, and I'm too distant from day-to-day Perl programming anymore to > >>remember that offhand. > >> > >>>What are you planning? > >> > >>The overlap percentages are calculated using int(), so they truncate - an > >>overlap of 0.999% is reported as "no overlap". I'd prefer to replace that > >>with a ceil() so that 0.001% - 0.999% is reported as 1% overlap instead. > >> > >>I'd be open to Math::Round() as well. > >> > >>It shouldn't affect score generation but would potentially make combination > >>analysis for FP tuning a little better. > > > >Shouldn't need any module, just something like > > > >my $ceil = int($num + 0.9999); > > I'd rather not roll my own if a standard library module function is > available.
Well first of all, that pretty much _is_ the ceil function. There's nothing "own" to roll. It's a simple calculation, so why would you not use it? Second of all: https://perldoc.perl.org/POSIX.html "Everything is exported by default (with a handful of exceptions). This is an unfortunate backwards compatibility feature and its use is strongly discouraged." Something like "use POSIX qw(:math_h)" would much much more approriate instead of "use POSIX", if you still insist using the module.
