Difference between revisions of "Template:Constant"

From blackwiki
Jump to navigation Jump to search
imported>Diriector Doc
(Added tau (2pi) and phi (golden ratio))
imported>Diriector Doc
(Added the Plastic number (ρ))
 
Line 1: Line 1:
 
<includeonly>{{#switch: {{{1}}}
 
<includeonly>{{#switch: {{{1}}}
|pi   = {{#switch: {{{2|value}}}
+
|pi     = {{#switch: {{{2|value}}}
            |value  = {{#ifexpr: {{{places|8}}} > 50
+
              |value  = {{#ifexpr: {{{places|8}}} > 50
                      <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!-- -->|{{#ifexpr: {{{places|8}}} < 0
+
                  <!-- -->|{{#ifexpr: {{{places|8}}} < 0
                      <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    -->|{{#ifeq: {{mod|{{{places|8}}}|1}} | 0
+
                  <!--    -->|{{#ifeq: {{mod|{{{places|8}}}|1}} | 0
                      <!--        -->|{{#ifeq: {{{places|8}}} | 0
+
                  <!--        -->|{{#ifeq: {{{places|8}}} | 0
                      <!--            -->|3
+
                  <!--            -->|3
                      <!--            -->|{{#switch: {{{round|no}}}
+
                  <!--            -->|{{#switch: {{{round|no}}}
                      <!--                -->|yes  = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|yes  = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|y    = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|y    = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|true = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|true = {{Str left|3.14159265358979323846264338327950288419716939937510|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|#default = {{Str left|3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 2}}}}
+
                  <!--                -->|#default = {{Str left|3.141592653589793238462643383279502884197169399375105|{{#expr: {{{places|8}}} + 2}}}}
                      <!--            --> }}
+
                  <!--            --> }}
                      <!--        --> }}
+
                  <!--        --> }}
                      <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    --> }}
+
                  <!--    --> }}
                      <!-- --> }}
+
                  <!-- --> }}
                      }}
+
                  }}
            |symbol = {{#switch: {{{link|no}}}
+
              |symbol = {{#switch: {{{link|no}}}
                          |yes  = [[Pi|{{pi}}]]
+
                          |yes  = [[Pi|{{pi}}]]
                          |y    = [[Pi|{{pi}}]]
+
                          |y    = [[Pi|{{pi}}]]
                          |true = [[Pi|{{pi}}]]
+
                          |true = [[Pi|{{pi}}]]
                          |#default = {{pi}}
+
                          |#default = {{pi}}
                      }}
+
                        }}
        }}
+
          }}
|e     = {{#switch: {{{2|value}}}
+
|e       = {{#switch: {{{2|value}}}
            |value  = {{#ifexpr: {{{places|8}}} > 50
+
              |value  = {{#ifexpr: {{{places|8}}} > 50
                      <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!-- -->|{{#ifexpr: {{{places|8}}} < 0
+
                  <!-- -->|{{#ifexpr: {{{places|8}}} < 0
                      <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    -->|{{#ifexpr: {{mod|{{{places|8}}}|1}} = 0
+
                  <!--    -->|{{#ifexpr: {{mod|{{{places|8}}}|1}} = 0
                      <!--        -->|{{#ifeq: {{{places|8}}} | 0
+
                  <!--        -->|{{#ifeq: {{{places|8}}} | 0
                      <!--            -->|{{#switch: {{{round|no}}}
+
                  <!--            -->|{{#switch: {{{round|no}}}
                      <!--                -->|yes  = 3
+
                  <!--                -->|yes  = 3
                      <!--                -->|y    = 3
+
                  <!--                -->|y    = 3
                      <!--                -->|true = 3
+
                  <!--                -->|true = 3
                      <!--                -->|#default = 2
+
                  <!--                -->|#default = 2
                      <!--            --> }}
+
                  <!--            --> }}
                      <!--            -->|{{#switch: {{{round|no}}}
+
                  <!--            -->|{{#switch: {{{round|no}}}
                      <!--                -->|yes  = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|yes  = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|y    = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|y    = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|true = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|true = {{Str left|2.71828182845904523536028747135266249775724709369995|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|#default = {{Str left|2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 2}}}}
+
                  <!--                -->|#default = {{Str left|2.718281828459045235360287471352662497757247093699959|{{#expr: {{{places|8}}} + 2}}}}
                      <!--            --> }}
+
                  <!--            --> }}
                      <!--        --> }}
+
                  <!--        --> }}
                      <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    --> }}
+
                  <!--    --> }}
                      <!-- --> }}
+
                  <!-- --> }}
                      }}
+
                  }}
            |symbol = {{#switch: {{{link|no}}}
+
              |symbol = {{#switch: {{{link|no}}}
                          |yes  = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
+
                          |yes  = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
                          |y    = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
+
                          |y    = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
                          |true  = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
+
                          |true  = <span class="texhtml mvar" style="font-style:italic;">[[e (mathematical constant)|e]]</span>
                          |#default = <span class="texhtml mvar" style="font-style:italic;">e</span>
+
                          |#default = <span class="texhtml mvar" style="font-style:italic;">e</span>
                      }}
+
                        }}
        }}
+
          }}
|tau   = {{#switch: {{{2|value}}}
+
|tau     = {{#switch: {{{2|value}}}
            |value  = {{#ifexpr: {{{places|8}}} > 50
+
              |value  = {{#ifexpr: {{{places|8}}} > 50
                      <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!-- -->|{{#ifexpr: {{{places|8}}} < 0
+
                  <!-- -->|{{#ifexpr: {{{places|8}}} < 0
                      <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    -->|{{#ifeq: {{mod|{{{places|8}}}|1}} | 0
+
                  <!--    -->|{{#ifeq: {{mod|{{{places|8}}}|1}} | 0
                      <!--        -->|{{#ifeq: {{{places|8}}} | 0
+
                  <!--        -->|{{#ifeq: {{{places|8}}} | 0
                      <!--            -->|6
+
                  <!--            -->|6
                      <!--            -->|{{#switch: {{{round|no}}}
+
                  <!--            -->|{{#switch: {{{round|no}}}
                      <!--                -->|yes  = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|yes  = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|y    = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|y    = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|true = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|true = {{Str left|6.28318530717958647692528676655900576839433879875021|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|#default = {{Str left|6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 2}}}}
+
                  <!--                -->|#default = {{Str left|6.283185307179586476925286766559005768394338798750211|{{#expr: {{{places|8}}} + 2}}}}
                      <!--            --> }}
+
                  <!--            --> }}
                      <!--        --> }}
+
                  <!--        --> }}
                      <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    --> }}
+
                  <!--    --> }}
                      <!-- --> }}
+
                  <!-- --> }}
                      }}
+
                  }}
            |symbol = {{#switch: {{{link|no}}}
+
              |symbol = {{#switch: {{{link|no}}}
                          |yes  = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
+
                          |yes  = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
                          |y    = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
+
                          |y    = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
                          |true = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
+
                          |true = [[Turn_(geometry)#Tau_proposals|{{tau}}]]
                          |#default = {{tau}}
+
                          |#default = {{tau}}
                      }}
+
                        }}
        }}
+
          }}
|phi   = {{#switch: {{{2|value}}}
+
|phi     = {{#switch: {{{2|value}}}
 
             |value  = {{#ifexpr: {{{places|8}}} > 50
 
             |value  = {{#ifexpr: {{{places|8}}} > 50
 
                       <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
 
                       <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
Line 125: Line 125:
 
                           |#default = {{phi}}
 
                           |#default = {{phi}}
 
                       }}
 
                       }}
        }}
+
          }}
|i     = {{#switch: {{{2|value}}}
+
|i       = {{#switch: {{{2|value}}}
            |value  = √<span style="border-top:1px solid; padding:0 0.1em;">-1</span>
+
              |value  = √<span style="border-top:1px solid; padding:0 0.1em;">-1</span>
            |symbol = {{#switch: {{{link|no}}}
+
              |symbol = {{#switch: {{{link|no}}}
                          |yes  = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
+
                          |yes  = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
                          |y    = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
+
                          |y    = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
                          |true  = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
+
                          |true  = <span class="texhtml mvar" style="font-style:italic;">[[Imaginary unit|i]]</span>
                          |#default = <span class="texhtml mvar" style="font-style:italic;">i</span>
+
                          |#default = <span class="texhtml mvar" style="font-style:italic;">i</span>
                      }}
+
                        }}
        }}
+
          }}
|root2 = {{#switch: {{{2|value}}}
+
|root2   = {{#switch: {{{2|value}}}
            |value  = {{#ifexpr: {{{places|8}}} > 50
+
              |value  = {{#ifexpr: {{{places|8}}} > 50
                      <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!-- -->|{{#ifexpr: {{{places|8}}} < 0
+
                  <!-- -->|{{#ifexpr: {{{places|8}}} < 0
                      <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    -->|{{#ifexpr: {{mod|{{{places|8}}}|1}} = 0
+
                  <!--    -->|{{#ifexpr: {{mod|{{{places|8}}}|1}} = 0
                      <!--        -->|{{#ifeq: {{{places|8}}} | 0
+
                  <!--        -->|{{#ifeq: {{{places|8}}} | 0
                      <!--            -->|1
+
                  <!--            -->|1
                      <!--            -->|{{#switch: {{{round|no}}}
+
                  <!--            -->|{{#switch: {{{round|no}}}
                      <!--                -->|yes  = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|yes  = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|y    = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|y    = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|true = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
+
                  <!--                -->|true = {{Str left|1.41421356237309504880168872420969807856967187537694|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left  
                                                      |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
+
                                                  |1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
                      <!--                -->|#default = {{Str left|1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 2}}}}
+
                  <!--                -->|#default = {{Str left|1.414213562373095048801688724209698078569671875376948|{{#expr: {{{places|8}}} + 2}}}}
                      <!--            --> }}
+
                  <!--            --> }}
                      <!--        --> }}
+
                  <!--        --> }}
                      <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
+
                  <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
                      <!--    --> }}
+
                  <!--    --> }}
                      <!-- --> }}
+
                  <!-- --> }}
                      }}
+
                  }}
            |symbol = {{#switch: {{{link|no}}}
+
              |symbol = {{#switch: {{{link|no}}}
                          |yes  = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
+
                          |yes  = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
                          |y    = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
+
                          |y    = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
                          |true  = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
+
                          |true  = [[Square root of 2|√<span style="border-top:1px solid currentColor; padding:0 0.1em;">2</span>]]
                          |#default = √<span style="border-top:1px solid; padding:0 0.1em;">2</span>
+
                          |#default = √<span style="border-top:1px solid; padding:0 0.1em;">2</span>
                      }}
+
                        }}
        }}
+
          }}
 +
|plastic = {{#switch: {{{2|value}}}
 +
              |value  = {{#ifexpr: {{{places|8}}} > 50
 +
                  <!-- -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
 +
                  <!-- -->|{{#ifexpr: {{{places|8}}} < 0
 +
                  <!--    -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
 +
                  <!--    -->|{{#ifexpr: {{mod|{{{places|8}}}|1}} = 0
 +
                  <!--        -->|{{#ifeq: {{{places|8}}} | 0
 +
                  <!--            -->|1
 +
                  <!--            -->|{{#switch: {{{round|no}}}
 +
                  <!--                -->|yes  = {{Str left|1.32471795724474602596090885447809734073440405690173|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left
 +
                                                  |1.324717957244746025960908854478097340734404056901733|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
 +
                  <!--                -->|y    = {{Str left|1.32471795724474602596090885447809734073440405690173|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left
 +
                                                  |1.324717957244746025960908854478097340734404056901733|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
 +
                  <!--                -->|true = {{Str left|1.32471795724474602596090885447809734073440405690173|{{#expr: {{{places|8}}} + 1}}}}{{Str left|{{#expr:{{str rightc|{{Str left
 +
                                                  |1.324717957244746025960908854478097340734404056901733|{{#expr: {{{places|8}}} + 3}}}}|2}} round -1}}|1}}
 +
                  <!--                -->|#default = {{Str left|1.324717957244746025960908854478097340734404056901733|{{#expr: {{{places|8}}} + 2}}}}
 +
                  <!--            --> }}
 +
                  <!--        --> }}
 +
                  <!--        -->|{{error|message=Error: Parameter {{para|places}} (Your input {{{places}}}) must be an integer between 0 and 50}}
 +
                  <!--    --> }}
 +
                  <!-- --> }}
 +
                  }}
 +
              |symbol = {{#switch: {{{link|no}}}
 +
                          |yes  = [[Plastic number|{{math|''ρ''}}]]
 +
                          |y    = [[Plastic number|{{math|''ρ''}}]]
 +
                          |true  = [[Plastic number|{{math|''ρ''}}]]
 +
                          |#default = {{math|''ρ''}}
 +
                        }}
 +
          }}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 19:28, 26 May 2018

Template documentation[view] [edit] [history] [purge]

Description

Will display either the value of or the symbol of a maths constant chosen by the user.

Parameters

{{constant | {{{1}}} | {{{2}}} | places= | round= | link=}}

  • |{{{1}}}
Required. Defines which constant to display.
Possible Values: e; pi; tau; root2; phi; plastic; i;
  • |{{{2}}}
Suggested. Defines whether to display the value of the constant or the symbol.
Possible Values: symbol; value; Default: value
  • |places=
Suggested. Defines the number of decimal places to display. Ignored if displaying symbol.
Possible Values: Any integer from 0 to 50; Default: 8
  • |round=
Choose whether or not to round when picking number of decimal places.
Possible Values: true; yes; y; Default: false
  • |link=
Choose whether or not to turn the symbol into a wiki-link that leads to the constants' respective pages. Ignored if displaying value.
Possible Values: true; yes; y; Default: false

Examples

Code Output Notes
{{constant|e}}
{{constant|pi}}
{{constant|tau}}
{{constant|root2}}
{{constant|phi}}
{{constant|plastic}}
{{constant|i}}
Expression error: Unrecognized punctuation character "[".
Error: Parameter |places= (Your input {{{places}}}) must be an integer between 0 and 50
Error: Parameter |places= (Your input {{{places}}}) must be an integer between 0 and 50
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
→√-1
i has no decimal value, so it gets displayed as √-1
{{constant|e|round=true}}
{{constant|e|places=9}}
{{constant|e|places=14|round=true}}
{{constant|e|places=14|round=false}}
{{constant|e|places=50}}
{{constant|e|places=0|round=true}}
{{constant|e|places=0}}
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
Expression error: Unrecognized punctuation character "[".
{{constant|e|symbol}}
{{constant|pi|symbol}}
{{constant|tau|symbol}}
{{constant|root2|symbol}}
{{constant|phi|symbol}}
{{constant|plastic|symbol}}
{{constant|i|symbol}}
e
Template:Pi
Template:Tau
→√2
Template:Phi
ρ
i
{{constant|e|symbol|link=true}}
{{constant|pi|symbol|link=true}}
{{constant|tau|symbol|link=true}}
{{constant|root2|symbol|link=true}}
{{constant|phi|symbol|link=true}}
{{constant|plastic|symbol|link=true}}
{{constant|i|symbol|link=true}}
e
→[[Pi|Template:Pi]]
→[[Turn_(geometry)#Tau_proposals|Template:Tau]]
2
→[[Golden ratio|Template:Phi]]
ρ
i
All links lead to their respective pages
{{constant|e|value|link=true}}
{{constant|e|symbol|places=9}}
{{constant|e|symbol|round=true}}
{{constant|e|places=51}}
{{constant|e|places=2.5}}
{{constant|i|places=4|round=true}}
{{constant|i|round=true}}
Expression error: Unrecognized punctuation character "[".
e
e
Error: Parameter |places= (Your input 51) must be an integer between 0 and 50
Expression error: Unrecognized punctuation character "[".
→√-1
→√-1
|link=true ignored because you are displaying a value
|places=9 ignored because you are displaying a symbol
|rount=true ignored because you are displaying a symbol
51 is too high
2.5 is not an integer
|places=4 ignored because i has no decimal value
|round=true ignored because i has no decimal value

TemplateData

The following section has been automatically generated by Wikipedia using TemplateData.

Displays either the value or the symbol for one of seven mathematical constants chosen by user.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Constant Name1

Defines which constant to display.

Example
e, pi , tau, root2, phi, plastic, i
Stringrequired
Display Type2

Defines whether to display the value of the constant or the symbol.

Default
value
Example
symbol, value
Stringsuggested
Placesplaces

Defines the number of decimal places to display. Ignored if displaying symbol.

Default
8
Example
0, 50, any integer in between
Numbersuggested
Linklink

Choose whether or not to turn the symbol into a wiki-link that leads to the constants' respective pages. Ignored if displaying value.

Default
false
Example
true, yes, y
Booleanoptional
Roundround

Choose whether or not to round when displaying decimal places.

Default
false
Example
true, yes, y
Booleanoptional