Difference between revisions of "Documentation/How Tos/Calc: LCM function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(Initial content) |
m |
||
Line 3: | Line 3: | ||
== LCM == | == LCM == | ||
Returns the least common multiple of one or more integers. | Returns the least common multiple of one or more integers. | ||
− | |||
=== Syntax: === | === Syntax: === | ||
Line 10: | Line 9: | ||
: The least common multiple (or lowest common multiple) is the smallest positive integer that is a multiple of all the given numbers. | : The least common multiple (or lowest common multiple) is the smallest positive integer that is a multiple of all the given numbers. | ||
− | |||
=== Example: === | === Example: === | ||
Line 18: | Line 16: | ||
<tt>'''LCM(B1:C1)'''</tt> | <tt>'''LCM(B1:C1)'''</tt> | ||
: where B1 and C1 contain <tt>'''6'''</tt> and <tt>'''3'''</tt> respectively, returns <tt>'''6'''</tt>. | : where B1 and C1 contain <tt>'''6'''</tt> and <tt>'''3'''</tt> respectively, returns <tt>'''6'''</tt>. | ||
− | |||
=== See also: === | === See also: === | ||
Line 26: | Line 23: | ||
'''[[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]''' | '''[[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]''' | ||
− | |||
=== Issues: === | === Issues: === | ||
To comply with the ODFF standard, from OOo3.0 negative arguments to <tt>'''LCM'''</tt> will yield an error. | To comply with the ODFF standard, from OOo3.0 negative arguments to <tt>'''LCM'''</tt> will yield an error. |
Revision as of 07:06, 2 March 2008
LCM
Returns the least common multiple of one or more integers.
Syntax:
LCM(integer1; integer2; ... integer30)
- integer1 to integer30 are up to 30 integers or ranges of integers whose least common multiple is to be calculated.
- The least common multiple (or lowest common multiple) is the smallest positive integer that is a multiple of all the given numbers.
Example:
LCM(4; 6)
- returns 12, which is the smallest positive integer that is a multiple of 4 (12=4*3) and 6 (12=6*2).
LCM(B1:C1)
- where B1 and C1 contain 6 and 3 respectively, returns 6.
See also:
Issues:
To comply with the ODFF standard, from OOo3.0 negative arguments to LCM will yield an error.