Arithmetic/Integer: Difference between revisions

no edit summary
m (formatting tweak)
No edit summary
Line 1,520:
No exponentiation operator exists, but can be worked around with the .NET BCL:
<lang powershell>[Math]::Pow($a, $b)</lang>
=={{header|ProDOS}}==
<lang ProDOS>
IGNORELINE Note: This example includes the math module.
include arithmeticmodule
:a
editvar /newvar /value=a /title=Enter first integer:
editvar /newvar /value=b /title=Enter second integer:
editvar /newvar /value=c
do add -a-,-b-=-c-
printline -c-
do subtract a,b
printline -c-
do multiply a,b
printline -c-
do divide a,b
printline -c-
do modulus a,b
printline -c-
editvar /newvar /value=d /title=Do you want to calculate more numbers?
if -d- /hasvalue yes goto :a else goto :end
:end
 
<lang ProDOS>
IGNORELINE Note: This example does not use the math module.
:a
editvar /newvar /value=a /title=Enter first integer:
editvar /newvar /value=b /title=Enter second integer:
editvar /newvar /value=-a-+-b-=-c-
printline -c-
editvar /newvar /value=a*b=c
printline -c-
editvar /newvar /value=a/b=c
printline -c-
editvar /newvar /value=a %% b=c
printline -c-
editvar /newvar /value=d /title=Do you want to calculate more numbers?
if -d- /hasvalue yes goto :a else goto :end
:end
=={{header|PureBasic}}==
 
Anonymous user