Difference between revisions of "Template:Evalint"

From blackwiki
Jump to navigation Jump to search
imported>Cydebot
m (Robot - Removing category Templates using ParserFunctions per CFD at Wikipedia:Categories for discussion/Log/2008 August 21.)
imported>Amalthea
(Use safesubst: (meta:Help:Safesubst))
Line 1: Line 1:
<includeonly><onlyinclude>{{ {{{subst|}}}#ifexpr: 1000000000000 <= ({{{1}}}) and ({{{1}}}) < 1000000000000000000000000
+
<includeonly><onlyinclude>{{ {{{|safesubst:}}}#ifexpr: 1000000000000 <= ({{{1}}}) and ({{{1}}}) < 1000000000000000000000000
|{{ {{{subst|}}}#expr: ({{{1}}}) / 1000000000000 mod 1000000000000}}{{
+
|{{ {{{|safesubst:}}}#expr: ({{{1}}}) / 1000000000000 mod 1000000000000}}{{
  {{{subst|}}}padleft:{{ {{{subst|}}}#expr: ({{{1}}}) mod 1000000000000}}|12|0}}
+
  {{{|safesubst:}}}padleft:{{ {{{|safesubst:}}}#expr: ({{{1}}}) mod 1000000000000}}|12|0}}
|{{ {{{subst|}}}#expr: {{{1}}} }} }}</onlyinclude></includeonly>
+
|{{ {{{|safesubst:}}}#expr: {{{1}}} }} }}</onlyinclude></includeonly>
 
{{tim|evalint}}
 
{{tim|evalint}}
 
----
 
----
<pre><nowiki>{{ {{{subst|}}}#ifexpr: 1000000000000 <= ({{{1}}}) and ({{{1}}}) < 1000000000000000000000000
+
<pre><nowiki>{{ {{{|safesubst:}}}#ifexpr: 1000000000000 <= ({{{1}}}) and ({{{1}}}) < 1000000000000000000000000
|{{ {{{subst|}}}#expr: ({{{1}}}) / 1000000000000 mod 1000000000000}}{{
+
|{{ {{{|safesubst:}}}#expr: ({{{1}}}) / 1000000000000 mod 1000000000000}}{{
  {{{subst|}}}padleft:{{ {{{subst|}}}#expr: ({{{1}}}) mod 1000000000000}}|12|0}}
+
  {{{|safesubst:}}}padleft:{{ {{{|safesubst:}}}#expr: ({{{1}}}) mod 1000000000000}}|12|0}}
|{{ {{{subst|}}}#expr: {{{1}}} }} }}</nowiki></pre>
+
|{{ {{{|safesubst:}}}#expr: {{{1}}} }} }}</nowiki></pre>
 
----
 
----
  
'''EVAL'''uates '''INT'''egers exactly up to 1E16, in a form suitable for input. Numbers between 1E16 and 1E24 are rounded. Larger results are given in scientific notation.
+
'''EVAL'''uates '''INT'''egers exactly up to 1E16, in a form suitable for input. Numbers between 1E16 and 1E24 are rounded. Larger results are given in scientific notation.<br>This template can be substituted.
  
 
*{{evaldemo/3|{{PAGENAME}}|2*1234567890123456}}
 
*{{evaldemo/3|{{PAGENAME}}|2*1234567890123456}}
Line 20: Line 20:
 
*{{evaldemo/3|{{PAGENAME}}|2*1234567890123456789012345}}
 
*{{evaldemo/3|{{PAGENAME}}|2*1234567890123456789012345}}
  
<nowiki>{{subst:evalint|2*1234567890123456|subst=subst:}}</nowiki> gives the wikitext 2469135780246912
+
<nowiki>{{subst:evalint|2*1234567890123456}}</nowiki> gives the wikitext 2469135780246912
  
  

Revision as of 11:19, 23 April 2010

m:Template:evalint (backlinks edit)


{{ {{{|safesubst:}}}#ifexpr: 1000000000000 <= ({{{1}}}) and ({{{1}}}) < 1000000000000000000000000
|{{ {{{|safesubst:}}}#expr: ({{{1}}}) / 1000000000000 mod 1000000000000}}{{
 {{{|safesubst:}}}padleft:{{ {{{|safesubst:}}}#expr: ({{{1}}}) mod 1000000000000}}|12|0}}
|{{ {{{|safesubst:}}}#expr: {{{1}}} }} }}

EVALuates INTegers exactly up to 1E16, in a form suitable for input. Numbers between 1E16 and 1E24 are rounded. Larger results are given in scientific notation.
This template can be substituted.

  • {{ Evalint | 2*1234567890123456 }} gives 2469135780246912
  • {{ #expr: 2*1234567890123456}} gives 2.4691357802469E+15
  • {{ Evalint | 11111111*11111111 }} gives 123456787654321
  • {{ #expr: 11111111*11111111}} gives 1.2345678765432E+14
  • {{ Evalint | 2*123456789012345678901234 }} gives 246913578024089023225856
  • {{ Evalint | 2*1234567890123456789012345 }} gives 2.4691357802469E+24

{{subst:evalint|2*1234567890123456}} gives the wikitext 2469135780246912

ja:Template:Evalint