This site is supported by donations to The OEIS Foundation.

Template:Log 10/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Log 10. [<Edit> Template:Log 10]

[⧼Purge⧽ Template:Log 10/doc]

The {{log_10}} mathematical function template returns the common logarithm of , where is a positive real number.

Usage

{{log_10|a positive real number}}

Valid input

A positive real number as argument.

Examples

Examples with valid input

Code Result
{{log_10|0.1}} -1
{{log_10|1}} 0
{{log_10|1.5}} 0.17609125905568
{{log_10|10}} 1
{{log_10|150}} 2.1760912590557
{{log_10|1000}} 3
{{log_10|10^40}} 40
{{log_10|10^25 * 10^40}} 65

Examples with invalid input (returns an error message)

Code Result
{{log_10|i}} Log_10 error: Argument must be a positive real number
{{log_10|-1}} Log_10 error: Argument must be a positive real number
{{log_10|0}} Log_10 error: Argument must be a positive real number

Code

{{ifnum| {{{1|not a number}}}
| {{#ifexpr: ({{{1}}}) > 0
  | {{#expr: ln ({{{1}}}) / ln 10 }}
  | {{error| Log_10 error: Argument must be a positive real number }}
  }}
| {{error| Log_10 error: Argument must be a positive real number }}
}}

See also