Calc Test Page: Difference between revisions

From Distillers Wiki
Jump to navigation Jump to search
No edit summary
(some calcs working now)
Line 9: Line 9:
   Testing to see if "expr" can use variables. It should. I think the issue is that the Vars aren't being defined properly so the equation fails.  
   Testing to see if "expr" can use variables. It should. I think the issue is that the Vars aren't being defined properly so the equation fails.  
UJ - It looks like the "Variables" module needs to be loaded. See : https://www.mediawiki.org/wiki/Extension:Variables Installation
UJ - It looks like the "Variables" module needs to be loaded. See : https://www.mediawiki.org/wiki/Extension:Variables Installation
 
y
SMY - I enabled the "variables" extension - UJ
SMY - I enabled the "variables" extension - UJ


Line 16: Line 16:
{{#vardefine:X|2}}
{{#vardefine:X|2}}
<br>
<br>
{{#var:Y|3 }}
{{#vardefine:Y|3}}
<br>
<br>
<br>'''Using Variables test calc3'''  {{#expr:{{X}}*{{Y}}}}
<br>'''Using Variables test calc3'''  {{#expr:{{X}}*{{Y}}}}
<br>'''Using Variables test calc4'''  {{#expr:{{#var:X}}*{{#var:Y}}}}
<br>'''Using Variables test calc4'''  {{#expr:{{#var:X}}*{{#var:Y}}}}
<br>'''Using Variables test calc5'''  {{#expr:X*Y}}
<br>'''Using Variables test calc5'''  {{#expr:#var:X*#var:Y}}
<br>
<br>


{{#var:a|3 }}
{{#vardefine:a|3 }}
{{#var:b|3 }}
{{#vardefine:b|9 }}
{{#vardefine:x|{{#expr:2*{{#var:a}}+{{#var:b}}}}}}
{{#var:x|{{#expr:2*{{#var:a}}+{{#var:b}}}}}}


<!-- Random php code test -->
<!-- Random php code test -->

Revision as of 05:24, 15 November 2022

Sample code test Calc e^43 = 4.7278394682294E+18

Simple Math test Calc2 2*3 = 6






Using Variables test calc3 Expression error: Unrecognized punctuation character "[".
Using Variables test calc4 6
Using Variables test calc5 Expression error: Unrecognized punctuation character "#".


15


<?php echo(pi()); ?>




Links to useful pages
https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
https://www.mediawiki.org/wiki/Extension:Variables