SYNOPSIS
use Math::PlanePath::Base::Generic 'round_nearest';
$x = round_nearest($x);
DESCRIPTION
This is a few generic helper functions for the PlanePath code. They're designed to work on plain Perl integers and floats and in some cases there's some special support for "Math::BigInt".EXPORTS
Nothing is exported by default but each function below can be as in the usual Exporter style,
use Math::PlanePath::Base::Generic 'round_nearest';
(But not "parameter_info_nstart0()" and "parameter_info_nstart1()", for the reason described below.)
FUNCTIONS
Generic
 "$x = round_nearest ($x)"

Return $x rounded to the nearest integer. If $x is half way, such as
2.5 then it's round upwards to 3.
$x = round_nearest($x);
 "$href = Math::PlanePath::Base::Generic::parameter_info_nstart0()"
 "$href = Math::PlanePath::Base::Generic::parameter_info_nstart1()"

Return an "n_start" parameter hashref suitable for use in a
"parameter_info_array()", with default either 0 or 1. For example,
# alone package Math::PlanePath::MySubclass; use constant parameter_info_array => [ Math::PlanePath::Base::Generic::parameter_info_nstart1() ]; # or with other parameters too package Math::PlanePath::MySubclass; use constant parameter_info_array => [ { name => 'something', type => 'integer', default => '123', }, Math::PlanePath::Base::Generic::parameter_info_nstart1(), ];
This function is not exportable since it's meant for a oneoff call in an initializer and so no need to import it for repeated use.
LICENSE
Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016 Kevin RydeThis file is part of MathPlanePath.
MathPlanePath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
MathPlanePath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with MathPlanePath. If not, see <http://www.gnu.org/licenses/>.