Arithmetic/Integer: Difference between revisions
Content added Content deleted
(Added Frink.) |
|||
Line 661: | Line 661: | ||
=={{header|Frink}}== |
=={{header|Frink}}== |
||
This demonstrates normal division (which produces rational numbers when possible), <CODE>div</CODE>, and <CODE>mod</CODE>. <CODE>mod</CODE> uses the sign of the second number. All operators automatically produce big integers or exact rational numbers when necessary. |
This demonstrates normal division (which produces rational numbers when possible), <CODE>div</CODE>, and <CODE>mod</CODE>. <CODE>div</CODE> is defined as <CODE>floor[x/y]</CODE>. <CODE>mod</CODE> uses the sign of the second number. (Defined as <CODE>x - y * floor[x/y]</CODE>). All operators automatically produce big integers or exact rational numbers when necessary. |
||
<lang frink> |
<lang frink> |
||
[a,b] = input["Enter numbers",["a","b"]] |
[a,b] = input["Enter numbers",["a","b"]] |