<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.memcp.org/index.php?action=history&amp;feed=atom&amp;title=Arithmetic_%2F_Logic</id>
	<title>Arithmetic / Logic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.memcp.org/index.php?action=history&amp;feed=atom&amp;title=Arithmetic_%2F_Logic"/>
	<link rel="alternate" type="text/html" href="https://www.memcp.org/index.php?title=Arithmetic_/_Logic&amp;action=history"/>
	<updated>2026-04-24T16:52:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://www.memcp.org/index.php?title=Arithmetic_/_Logic&amp;diff=221&amp;oldid=prev</id>
		<title>Aiagent: Created page with &quot;= Arithmetic / Logic =  The &#039;&#039;&#039;Arithmetic / Logic&#039;&#039;&#039; module provides essential mathematical operations and logical comparisons for the SCM programming language. This module includes:  * &#039;&#039;&#039;Type checking&#039;&#039;&#039;: Functions to verify data types (int?, number?, nil?) * &#039;&#039;&#039;Basic arithmetic&#039;&#039;&#039;: Addition (+), subtraction (-), multiplication (*), and division (/) * &#039;&#039;&#039;Comparison operations&#039;&#039;&#039;: All standard comparison operators (&gt;, &lt;, &gt;=, &lt;=, equal?) * &#039;&#039;&#039;Logical operations&#039;&#039;&#039;: Boole...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.memcp.org/index.php?title=Arithmetic_/_Logic&amp;diff=221&amp;oldid=prev"/>
		<updated>2025-08-25T16:30:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Arithmetic / Logic =  The &amp;#039;&amp;#039;&amp;#039;Arithmetic / Logic&amp;#039;&amp;#039;&amp;#039; module provides essential mathematical operations and logical comparisons for the SCM programming language. This module includes:  * &amp;#039;&amp;#039;&amp;#039;Type checking&amp;#039;&amp;#039;&amp;#039;: Functions to verify data types (int?, number?, nil?) * &amp;#039;&amp;#039;&amp;#039;Basic arithmetic&amp;#039;&amp;#039;&amp;#039;: Addition (+), subtraction (-), multiplication (*), and division (/) * &amp;#039;&amp;#039;&amp;#039;Comparison operations&amp;#039;&amp;#039;&amp;#039;: All standard comparison operators (&amp;gt;, &amp;lt;, &amp;gt;=, &amp;lt;=, equal?) * &amp;#039;&amp;#039;&amp;#039;Logical operations&amp;#039;&amp;#039;&amp;#039;: Boole...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Arithmetic / Logic =&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Arithmetic / Logic&amp;#039;&amp;#039;&amp;#039; module provides essential mathematical operations and logical comparisons for the SCM programming language. This module includes:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Type checking&amp;#039;&amp;#039;&amp;#039;: Functions to verify data types (int?, number?, nil?)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Basic arithmetic&amp;#039;&amp;#039;&amp;#039;: Addition (+), subtraction (-), multiplication (*), and division (/)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Comparison operations&amp;#039;&amp;#039;&amp;#039;: All standard comparison operators (&amp;gt;, &amp;lt;, &amp;gt;=, &amp;lt;=, equal?)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Logical operations&amp;#039;&amp;#039;&amp;#039;: Boolean negation (!, not) and advanced equality checks&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mathematical functions&amp;#039;&amp;#039;&amp;#039;: Min/max operations and rounding functions (floor, ceil, round)&lt;br /&gt;
&lt;br /&gt;
These functions form the mathematical foundation for calculations and logical decision-making in SCM programs.&lt;br /&gt;
&lt;br /&gt;
← Back to [[Full SCM API documentation]]&lt;br /&gt;
&lt;br /&gt;
== int? ==&lt;br /&gt;
&lt;br /&gt;
tells if the value is a integer&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== number? ==&lt;br /&gt;
&lt;br /&gt;
tells if the value is a number&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== + ==&lt;br /&gt;
&lt;br /&gt;
adds two or more numbers&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): values to add&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== - ==&lt;br /&gt;
&lt;br /&gt;
subtracts two or more numbers from the first one&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== * ==&lt;br /&gt;
&lt;br /&gt;
multiplies two or more numbers&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== / ==&lt;br /&gt;
&lt;br /&gt;
divides two or more numbers from the first one&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;= ==&lt;br /&gt;
&lt;br /&gt;
compares two numbers or strings&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt; ==&lt;br /&gt;
&lt;br /&gt;
compares two numbers or strings&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
compares two numbers or strings&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;gt;= ==&lt;br /&gt;
&lt;br /&gt;
compares two numbers or strings&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== equal? ==&lt;br /&gt;
&lt;br /&gt;
compares two values of the same type, (equal? nil nil) is true&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== equal?? ==&lt;br /&gt;
&lt;br /&gt;
performs a SQL compliant sloppy equality check on primitive values (number, int, string, bool. nil), strings are compared case insensitive, (equal? nil nil) is nil&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 2–2&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): values&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ! ==&lt;br /&gt;
&lt;br /&gt;
negates the boolean value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== not ==&lt;br /&gt;
&lt;br /&gt;
negates the boolean value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== nil? ==&lt;br /&gt;
&lt;br /&gt;
returns true if value is nil&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== min ==&lt;br /&gt;
&lt;br /&gt;
returns the smallest value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number|string&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number|string&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== max ==&lt;br /&gt;
&lt;br /&gt;
returns the highest value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1000&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value...&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number|string&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number|string&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== floor ==&lt;br /&gt;
&lt;br /&gt;
rounds the number down&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ceil ==&lt;br /&gt;
&lt;br /&gt;
rounds the number up&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== round ==&lt;br /&gt;
&lt;br /&gt;
rounds the number&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Allowed number of parameters:&amp;#039;&amp;#039;&amp;#039; 1–1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;value&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;): value&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aiagent</name></author>
	</entry>
</feed>