<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://code-reference.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://code-reference.com/feed.php">
        <title>Programming | Library | Reference - Code-Reference.com arduino:math</title>
        <description></description>
        <link>https://code-reference.com/</link>
        <image rdf:resource="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-18T16:47:23+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/abs?rev=1708041860&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/constrain?rev=1708041861&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/map?rev=1708041860&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/max?rev=1708041861&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/min?rev=1708041860&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/pow?rev=1708041861&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/arduino/math/sqrt?rev=1708041860&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Programming | Library | Reference - Code-Reference.com</title>
        <link>https://code-reference.com/</link>
        <url>https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://code-reference.com/arduino/math/abs?rev=1708041860&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:20+02:00</dc:date>
        <title>abs(x)</title>
        <link>https://code-reference.com/arduino/math/abs?rev=1708041860&amp;do=diff</link>
        <description>Description

Computes the absolute value of a number.

Parameters

x: the number

Returns

x: if x is greater than or equal to 0.

-x: if x is less than 0.

Warning

Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results.</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/constrain?rev=1708041861&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:21+02:00</dc:date>
        <title>constrain(x, a, b)</title>
        <link>https://code-reference.com/arduino/math/constrain?rev=1708041861&amp;do=diff</link>
        <description>Description

Constrains a number to be within a range.

Parameters

x: the number to constrain, all data types

a: the lower end of the range, all data types

b: the upper end of the range, all data types

Returns

x: if x is between a and b

a: if x is less than a</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/map?rev=1708041860&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:20+02:00</dc:date>
        <title>map(value, fromLow, fromHigh, toLow, toHigh)</title>
        <link>https://code-reference.com/arduino/math/map?rev=1708041860&amp;do=diff</link>
        <description>Description

Re-maps a number from one range to another.  That is, a value of fromLow would get mapped to toLow, a value of fromHigh to toHigh, values in-between to values in-between, etc.

Does not constrain values to within the range, because out-of-range values are sometimes intended and useful. The constrain() function may be used either before or after this function, if limits to the ranges are desired.</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/max?rev=1708041861&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:21+02:00</dc:date>
        <title>max(x, y)</title>
        <link>https://code-reference.com/arduino/math/max?rev=1708041861&amp;do=diff</link>
        <description>Description

Calculates the maximum of two numbers.

Parameters

x: the first number, any data type

y: the second number, any data type

Returns

The larger of the two parameter values.

Example

sensVal = max(senVal, 20); // assigns sensVal to the larger of sensVal or 20
                           // (effectively ensuring that it is at least 20)</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/min?rev=1708041860&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:20+02:00</dc:date>
        <title>min(x, y)</title>
        <link>https://code-reference.com/arduino/math/min?rev=1708041860&amp;do=diff</link>
        <description>Description

Calculates the minimum of two numbers.

Parameters

x: the first number, any data type

y: the second number, any data type

Returns

The smaller of the two numbers.

Examples

sensVal = min(sensVal, 100); // assigns sensVal to the smaller of sensVal or 100
                             // ensuring that it never gets above 100.</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/pow?rev=1708041861&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:21+02:00</dc:date>
        <title>pow(base, exponent)</title>
        <link>https://code-reference.com/arduino/math/pow?rev=1708041861&amp;do=diff</link>
        <description>Description

Calculates the value of a number raised to a power. Pow() can be used to raise a number to a fractional power. This is useful for generating exponential mapping of values or curves.

Parameters

base: the number (float)

exponent: the power to which the base is raised (float)</description>
    </item>
    <item rdf:about="https://code-reference.com/arduino/math/sqrt?rev=1708041860&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:20+02:00</dc:date>
        <title>sqrt(x)</title>
        <link>https://code-reference.com/arduino/math/sqrt?rev=1708041860&amp;do=diff</link>
        <description>Description

Calculates the square root of a number.

Parameters

x: the number, any data type

Returns

double, the number's square root.

See also

* pow(base, exponent)
* sq

Source: arduino.cc</description>
    </item>
</rdf:RDF>
