DateTime-Util-Calc

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

This is the license from "Calendrical Calculations", and code that was
ported from it.

---

The Functions (code, comments, and definitions) contained on this compact disk (the "Program") were written by Edward M. Reingold and Nachum Dershowitz (the "Authors"), who retain all rights to them except as granted in the License and subject to the...

The Authors' public service intent is more liberal than suggested by the License below, as are their licensing policies for otherwise nonallowed uses such as--without limitation--those in commercial, web-site, and large-scale academic contexts. Pleas...

http://www.calendarists.com

for all uses not authorized below; in case there is cause for doubt about whether a use you contemplate is authorized, please contact the Authors (email: reingold@iit.edu) . For commercial licensing information, contact the first author at the Depart...

1. LICENSE. The Authors grant you a license for personal use only. This means that for strictly personal use you may copy and use the code, and keep a backup or archival copy also. Any other uses, including without limitation, allowing the code or it...

2. WARRANTY.

(a) THE AUTHORS PROVIDE NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

(b) THE AUTHORS SHALL NOT BE LIABLE TO YOU OR ANY THIRD PARTIES FOR DAMAGES OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS, OR ANY OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THE USE, INABILITY TO...

lib/DateTime/Util/Calc.pm  view on Meta::CPAN


  use DateTime::Util::Calc qw(polynomial);

  my @coeffs = qw(2 3 -2);
  my $x      = 5;
  my $rv     = polynomial($x, @coeffs);

=head1 DEPRECATION WARNING

You really should not be using this module. Math::BigInt nad friends are fine,
but they are not realistic for anything more complicated... like calendars.
If you need an astronomical calendar, use C (and/or provide a very thing
Perl wrapper over it)

Because the author has reached the above conclusion, this module should really
be considered deprecated. It will NOT be maintained regularly.

=head1 DESCRIPTION

This module contains some common calculation utilities that are required
to perform datetime calculations, specifically from "Calendrical Calculations"
-- they are NOT meant to be general purpose.

t/07-mod.t  view on Meta::CPAN

#!perl
use Test::More tests => 18;
BEGIN
{
    use_ok("DateTime::Util::Calc", qw(mod amod));
}

sub is_mod { is(mod($_[0], $_[1]), $_[2], "$_[0] mod $_[1] is $_[2]") }

# definitions from calendarical caluculations
is_mod(9, 5, 4);
is_mod(-9, 5, 1);
is_mod(9, -5, -1);
is_mod(-9, -5, -4);

is_mod(5 / 3, 3 / 4, 1 / 6);
#is_mod(Math::BigFloat->new(5) / 3, Math::BigFloat->new(3) / 4, Math::BigFloat->new(1) / 6);

# Arbitrary testing



( run in 0.343 second using v1.01-cache-2.11-cpan-5dc5da66d9d )