-
-
19 Jan 2021 06:32:01 UTC
- Distribution: Math-PlanePath
- Module version: 129
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Issues (0)
- Testers (350 / 1 / 0)
- Kwalitee
Bus factor: 1- 69.45% Coverage
- License: gpl_3
- Perl: v5.4.0
- Activity
24 month- Tools
- Download (1.44MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- List::Util
- Math::Libm
- constant
- constant::defer
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Math::PlanePath::Base::Generic -- various path helpers
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()
andparameter_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 aparameter_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 one-off call in an initializer and so no need to import it for repeated use.
SEE ALSO
Math::PlanePath, Math::PlanePath::Base::Digits, Math::PlanePath::Base::NSEW
HOME PAGE
http://user42.tuxfamily.org/math-planepath/index.html
LICENSE
Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde
This file is part of Math-PlanePath.
Math-PlanePath 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.
Math-PlanePath 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 Math-PlanePath. If not, see <http://www.gnu.org/licenses/>.
Module Install Instructions
To install Math::PlanePath, copy and paste the appropriate command in to your terminal.
cpanm Math::PlanePath
perl -MCPAN -e shell install Math::PlanePath
For more information on module installation, please visit the detailed CPAN module installation guide.