.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Math::PlanePath::Base::Generic 3pm" .TH Math::PlanePath::Base::Generic 3pm "2016-05-03" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Math::PlanePath::Base::Generic \-\- various path helpers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Math::PlanePath::Base::Generic \*(Aqround_nearest\*(Aq; \& $x = round_nearest($x); .Ve .SH "DESCRIPTION" .IX Header "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 \f(CW\*(C`Math::BigInt\*(C'\fR. .SH "EXPORTS" .IX Header "EXPORTS" Nothing is exported by default but each function below can be as in the usual Exporter style, .PP .Vb 1 \& use Math::PlanePath::Base::Generic \*(Aqround_nearest\*(Aq; .Ve .PP (But not \f(CW\*(C`parameter_info_nstart0()\*(C'\fR and \f(CW\*(C`parameter_info_nstart1()\*(C'\fR, for the reason described below.) .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "Generic" .IX Subsection "Generic" .ie n .IP """$x = round_nearest ($x)""" 4 .el .IP "\f(CW$x = round_nearest ($x)\fR" 4 .IX Item "$x = round_nearest ($x)" Return \f(CW$x\fR rounded to the nearest integer. If \f(CW$x\fR is half way, such as 2.5 then it's round upwards to 3. .Sp .Vb 1 \& $x = round_nearest($x); .Ve .ie n .IP """$href = Math::PlanePath::Base::Generic::parameter_info_nstart0()""" 4 .el .IP "\f(CW$href = Math::PlanePath::Base::Generic::parameter_info_nstart0()\fR" 4 .IX Item "$href = Math::PlanePath::Base::Generic::parameter_info_nstart0()" .PD 0 .ie n .IP """$href = Math::PlanePath::Base::Generic::parameter_info_nstart1()""" 4 .el .IP "\f(CW$href = Math::PlanePath::Base::Generic::parameter_info_nstart1()\fR" 4 .IX Item "$href = Math::PlanePath::Base::Generic::parameter_info_nstart1()" .PD Return an \f(CW\*(C`n_start\*(C'\fR parameter hashref suitable for use in a \&\f(CW\*(C`parameter_info_array()\*(C'\fR, with default either 0 or 1. For example, .Sp .Vb 4 \& # 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 => \*(Aqsomething\*(Aq, \& type => \*(Aqinteger\*(Aq, \& default => \*(Aq123\*(Aq, \& }, \& Math::PlanePath::Base::Generic::parameter_info_nstart1(), \& ]; .Ve .Sp 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. .SH "SEE ALSO" .IX Header "SEE ALSO" Math::PlanePath, Math::PlanePath::Base::Digits, Math::PlanePath::Base::NSEW .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016 Kevin Ryde .PP This file is part of Math-PlanePath. .PP Math-PlanePath is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP Math-PlanePath is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with Math-PlanePath. If not, see .