71.

prev next contents
fcmpg

single-precision float comparison (1 on NaN)

Jasmin Syntax
     fcmpg 
Stack

Before

After
value1
int-result
value2
...
...

Description

This takes two single-precision floating point numbers off the stack and compares them, using IEEE 754 rules.

If the two numbers are the same, the integer 0 is pushed onto the stack. If value2 is greater than value1, the integer 1 is pushed onto the stack. If value1 is greater than value2, the integer -1 is pushed onto the stack. If either number is NaN, the integer 1 is pushed onto the stack. +0.0 and -0.0 are treated as equal.

Example

 fload_1       ; push the float in local variable 1 fconst_0      ; push the float 0 onto the stack fcmpl         ; compare the two numbers ; The integer result on the stack is: ;     0 if local variable 1 equals 0 ;     -1 if local variable 1 is less than 0 ;     1 if local variable 1 is greater than 0 

Bytecode

Type

Description
u1
fcmpg opcode = 0x96 (150)
See Also

lcmp, fcmpl, dcmpl, dcmpg

Notes

This instruction is identical to fcmpl except for the treatment of NaN.


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates


Java Virtual Machine
Java Virtual Machine (Java Series)
ISBN: 1565921941
EAN: 2147483647
Year: 1996
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net