📄 instructions2.doc116.html
字号:
<html><head><title>VM Spec </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000> <a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc115.html">Prev</a> | <a href="Instructions2.doc117.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="irem"></a><h2>irem</h2><a name="irem.Operation"></a><b>Operation</b><br><a name="69007"></a>Remainder <code>int</code><p><Table Border="3"><tr><td><a name="69006"></a> <i>irem</i><td><a name="87568"></a> </Table><Table><tr><td></Table><p><a name="irem.Forms"></a><b>Forms</b><br><a name="69008"></a><i>irem</i> = 112 (0x70)<p><a name="irem.Stack"></a><b>Stack</b><br><a name="69009"></a>..., <i>value1</i><em>, </em><i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p><a name="irem.Description"></a><b>Description</b><br><a name="69010"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. The <code>int</code> <i>result</i> is <i>value1</i> - (<i>value1</i> / <i>value2</i>) * <i>value2</i>. The <i>result</i> is pushed onto the operand stack.<p><a name="69011"></a>The result of the <i>irem</i> instruction is such that <code>(a/b)*b</code> <code>+</code> <code>(a%b)</code> is equal to <code>a</code>. This identity holds even in the special case that the dividend is the negative <code>int</code> of largest possible magnitude for its type and the divisor is -<code>1</code> (the remainder is <code>0</code>). It follows from this rule that the result of the remainder operation can be negative only if the dividend is negative and can be positive only if the dividend is positive. Moreover, the magnitude of the result is always less than the magnitude of the divisor. <p><a name="irem.Runtime"></a><b>Runtime Exception</b><br><a name="69013"></a>If the value of the divisor for an <code>int</code> remainder operator is 0, <i>irem</i> throws an <code>ArithmeticException</code>.<p><a name="69014"></a><p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc115.html">Prev</a> | <a href="Instructions2.doc117.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><p><font size=-1>Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)<br><i><a href="Copyright.doc.html">Copyright © 1996 Sun Microsystems, Inc.</a>All rights reserved</i><br>Please send any comments or corrections to <a href="mailto:doug.kramer@sun.com">doug.kramer@sun.com</a></font></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -