Math::PlanePath::Base::Generic3pm
Usage
use Math::PlanePath::Base::Generic 'round_nearest';$x = round_nearest($x);
Overview
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
$xrounded to the nearest integer. If$xis 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,# alonepackage Math::PlanePath::MySubclass;use constant parameter_info_array =>[ Math::PlanePath::Base::Generic::parameter_info_nstart1() ];# or with other parameters toopackage 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 one-off call in an initializer and so no need to import it for repeated use.
Home page
<http://user42.tuxfamily.org/math-planepath/index.html>
Releases
6 releases since Debian 8 (Jessie); the text changed 3 times.