mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 18:10:43 +01:00
55 lines
891 B
XML
55 lines
891 B
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>log()</name>
|
|
|
|
<category>Math</category>
|
|
|
|
<subcategory>Calculation</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
void setup() {
|
|
int i = 12;
|
|
println(log(i));
|
|
println(log10(i));
|
|
}
|
|
|
|
// Calculates the base-10 logarithm of a number
|
|
float log10 (int x) {
|
|
return (log(x) / log(10));
|
|
}
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Calculates the natural logarithm (the base-<i>e</i> logarithm) of a number. This function expects the values greater than 0.0.
|
|
</description>
|
|
|
|
<syntax>
|
|
log(<c>value</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>value</label>
|
|
<description>int or float: number must be greater then 0.0</description>
|
|
</parameter>
|
|
|
|
<returns>float</returns>
|
|
|
|
<related>
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Function</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
<level>Extended</level>
|
|
|
|
|
|
</root>
|