<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Test_AN%3A%3ATools%3A%3AMath</id>
	<title>Test AN::Tools::Math - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Test_AN%3A%3ATools%3A%3AMath"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;action=history"/>
	<updated>2026-05-30T04:57:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=4759&amp;oldid=prev</id>
		<title>Digimer at 03:23, 5 May 2013</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=4759&amp;oldid=prev"/>
		<updated>2013-05-05T03:23:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:23, 5 May 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{mod_header}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{mod_header}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;[https://alteeve.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;com&lt;/del&gt;/AN/t/Math.t t/Math.t]&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;[https://alteeve.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ca&lt;/ins&gt;/AN/t/Math.t t/Math.t]&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key an_wiki-mediawiki-:diff:1.41:old-85:rev-4759:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=85&amp;oldid=prev</id>
		<title>Digimer at 03:45, 20 September 2009</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=85&amp;oldid=prev"/>
		<updated>2009-09-20T03:45:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:45, 20 September 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[https://alteeve.com/AN/t/Math.t t/Math.t]&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[https://alteeve.com/AN/t/Math.t t/Math.t]&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;----&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=68&amp;oldid=prev</id>
		<title>Digimer: Created page with &#039;{{mod_header}}  &#039;&#039;&#039;[https://alteeve.com/AN/t/Math.t t/Math.t]&#039;&#039;&#039; ----  &lt;source lang=&quot;perl&quot;&gt; #!/usr/bin/perl -Tw # # This is the test script for the AN::Tools family of modules. # …&#039;</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Test_AN::Tools::Math&amp;diff=68&amp;oldid=prev"/>
		<updated>2009-09-20T03:12:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{mod_header}}  &amp;#039;&amp;#039;&amp;#039;[https://alteeve.com/AN/t/Math.t t/Math.t]&amp;#039;&amp;#039;&amp;#039; ----  &amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt; #!/usr/bin/perl -Tw # # This is the test script for the AN::Tools family of modules. # …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Páàjì titun&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{mod_header}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[https://alteeve.com/AN/t/Math.t t/Math.t]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/perl -Tw&lt;br /&gt;
#&lt;br /&gt;
# This is the test script for the AN::Tools family of modules.&lt;br /&gt;
# &lt;br /&gt;
&lt;br /&gt;
use AN::Tools 0.0.001;&lt;br /&gt;
my $an=AN::Tools-&amp;gt;new();&lt;br /&gt;
&lt;br /&gt;
# Make sure that $parent matches $an.&lt;br /&gt;
my $parent=$an-&amp;gt;Math-&amp;gt;parent();&lt;br /&gt;
is($an, $parent, &amp;quot;Internal &amp;#039;parent&amp;#039; method returns same blessed reference as is in \$an.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Make sure that all methods are available.&lt;br /&gt;
my @methods=(&amp;quot;parent&amp;quot;, &amp;quot;round&amp;quot;);&lt;br /&gt;
can_ok(&amp;quot;AN::Tools::Math&amp;quot;, @methods);&lt;br /&gt;
&lt;br /&gt;
# Test &amp;#039;round&amp;#039;&lt;br /&gt;
my $to_round=10.245;&lt;br /&gt;
my $to_places=2;&lt;br /&gt;
my $rounded=$an-&amp;gt;Math-&amp;gt;round($to_round, $to_places);&lt;br /&gt;
is($rounded, &amp;quot;10.25&amp;quot;, &amp;quot;round(); Two places using array-type args.&amp;quot;);&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;10.25&amp;quot;, &amp;quot;round(); to two places using hashref-type args.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# This inadvertantly tests Alert early, but is needed to disable fatal errors.&lt;br /&gt;
my $invalid_arg=&amp;quot;10.004f67&amp;quot;;&lt;br /&gt;
is($an-&amp;gt;Alert-&amp;gt;no_fatal_errors({set=&amp;gt;1}), 1, &amp;quot;Fatal errors disabled for next test.&amp;quot;);&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$invalid_arg,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, undef, &amp;quot;round(); Passed invalid arg caused failure returning undef.&amp;quot;);&lt;br /&gt;
is($an-&amp;gt;error_code(), 2, &amp;quot;\$an-&amp;gt;error_code() set to &amp;#039;2&amp;#039; after last error.&amp;quot;);&lt;br /&gt;
like($an-&amp;gt;error(), qr/^-=] 2 - .* \[=-/, &amp;quot;\$an-&amp;gt;error() contains an error message after last test.&amp;quot;);&lt;br /&gt;
is($an-&amp;gt;Alert-&amp;gt;no_fatal_errors({set=&amp;gt;0}), 0, &amp;quot;Fatal errors re-enabled.&amp;quot;);&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round($to_round, $to_places);&lt;br /&gt;
is($an-&amp;gt;error(), &amp;quot;&amp;quot;, &amp;quot;error(); Cleared after re-enabling fatal errors.&amp;quot;);&lt;br /&gt;
is($an-&amp;gt;error_code(), 0, &amp;quot;error_code(); Set back to &amp;#039;0&amp;#039; after last error.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# This time set the passed value to have fewer that the number of digits to&lt;br /&gt;
# round and ensure that the resulting value is padded.&lt;br /&gt;
$to_round=10.2;&lt;br /&gt;
$to_places=2;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;10.20&amp;quot;, &amp;quot;round(); Padded 0s to the right of the decimal place.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Test a string that has no digit before the decimal place.&lt;br /&gt;
$to_round=.2;&lt;br /&gt;
$to_places=2;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;0.20&amp;quot;, &amp;quot;round(); Put a 0 to the left of the decimal place where none existed.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Test a string that has no digit after the decimal place.&lt;br /&gt;
$to_round=2.;&lt;br /&gt;
$to_places=2;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;2.00&amp;quot;, &amp;quot;round(); Handled a number with no digits after the decimal place.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Test that I get a mathmatically accurate rounding.&lt;br /&gt;
$to_round=2.444445;&lt;br /&gt;
$to_places=0;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;3&amp;quot;, &amp;quot;round(); Financial rounding to a whole number.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Test that I get a mathmatically accurate rounding.&lt;br /&gt;
$to_round=2.444445;&lt;br /&gt;
$to_places=2;&lt;br /&gt;
$expect=&amp;quot;2.45&amp;quot;;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
	places	=&amp;gt;	$to_places&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;2.45&amp;quot;, &amp;quot;round(); Financial rounding to two places after the decimal place.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# Test that I get a mathmatically accurate rounding.&lt;br /&gt;
$to_round=2.444445;&lt;br /&gt;
$rounded=$an-&amp;gt;Math-&amp;gt;round({&lt;br /&gt;
	number	=&amp;gt;	$to_round,&lt;br /&gt;
});&lt;br /&gt;
is($rounded, &amp;quot;3&amp;quot;, &amp;quot;round(); Financial rounding to a whole number with no places defined.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
</feed>