📄 instructions2.doc50.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.doc49.html">Prev</a> | <a href="Instructions2.doc51.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="f2i"></a><h2>f2i</h2><a name="f2i.Operation"></a><b>Operation</b><br><a name="67896"></a>Convert <code>float</code> to <code>int</code><p><Table Border="3"><tr><td><a name="67895"></a> <i>f2i</i><td><a name="87568"></a> </Table><Table><tr><td></Table><p><a name="f2i.Forms"></a><b>Forms</b><br><a name="67897"></a><i>f2i</i> = 139 (0x8b)<p><a name="f2i.Stack"></a><b>Stack</b><br><a name="67898"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i><p><a name="f2i.Description"></a><b>Description</b><br><a name="67899"></a>The <i>value</i> on the top of the operand stack must be of type <code>float</code>. It is popped from the operand stack and converted to an <code>int</code>. The <i>result</i> is pushed onto the operand stack: <p><ul><a name="67900"></a><li>If the <i>value</i> is NaN, the <i>result</i> of the conversion is an <code>int</code> 0. <a name="67901"></a><li>Otherwise, if the <i>value</i> is not an infinity, it is rounded to an integer value <i>V</i>, rounding towards zero using IEEE 754 round-towards-zero mode. If this integer value <i>V</i> can be represented as an <code>int</code>, then the <i>result</i> is the <code>int</code> value <em>V</em>.<a name="67902"></a><li>Otherwise, either the <i>value</i> must be too small (a negative value of large magnitude or negative infinity), and the <i>result</i> is the smallest representable value of type <code>int</code>, or the <i>value</i> must be too large (a positive value of large magnitude or positive infinity), and the <i>result</i> is the largest representable value of type <code>int</code>.<a name="f2i.Notes"></a><b>Notes</b><br></ul><a name="67903"></a>The <i>f2i</i> instruction performs a narrowing primitive conversion <a href="Concepts.doc.html#26142">(§2.6.3)</a>. It may lose information about the overall magnitude of <i>value</i>, and may also lose precision.<p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc49.html">Prev</a> | <a href="Instructions2.doc51.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 + -