• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Chapter 2.  The Structure of the Java Virtual Machine

Started by PocketOption, Nov 12, 2022, 02:15 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PocketOption

Chapter 2.  The Structure of the Java Virtual Machine

Normalized floating point representation binary options.
The floating-point types are float and double , which are conceptually associated with the 32-bit single-precision and 64-bit double-precision format IEEE 754 values and operations as specified in IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std. 754-1985, New York).
The IEEE 754 standard includes not only positive and negative sign-magnitude numbers, but also positive and negative zeros, positive and negative infinities , and a special Not-a-Number value (hereafter abbreviated as "NaN"). The NaN value is used to represent the result of certain invalid operations such as dividing zero by zero.
Every implementation of the Java Virtual Machine is required to support two standard sets of floating-point values, called the float value set and the double value set . In addition, an implementation of the Java Virtual Machine may, at its option, support either or both of two extended-exponent floating-point value sets, called the float-extended-exponent value set and the double-extended-exponent value set . These extended-exponent value sets may, under certain circumstances, be used instead of the standard value sets to represent the values of type float or double .
The finite nonzero values of any floating-point value set can all be expressed in the form s ⋅ m ⋅ 2 ( e − N + 1) , where s is +1 or −1, m is a positive integer less than 2 N , and e is an integer between E min = −(2 K −1 −2) and E max = 2 K −1 −1, inclusive, and where N and K are parameters that depend on the value set. Some values can be represented in this form in more than one way; for example, supposing that a value v in a value set might be represented in this form using certain values for s , m , and e , then if it happened that m were even and e were less than 2 K -1 , one could halve m and increase e by 1 to produce a second representation for the same value v . A representation in this form is called normalized if m ≥ 2 N -1 ; otherwise the representation is said to be denormalized . If a value in a value set cannot be represented in such a way that m ≥ 2 N -1 , then the value is said to be a denormalized value , because it has no normalized representation.
The constraints on the parameters N and K (and on the derived parameters E min and E max ) for the two required and two optional floating-point value sets are summarized in Table 2.1.
Table 2.1. Floating-point value set parameters.
Parameter float float-extended-exponent double double-extended-exponent N 24 24 53 53 K 8 ≥ 11 11 ≥ 15 E max +127 ≥ +1023 +1023 ≥ +16383 E min -126 ≤ -1022 -1022 ≤ -16382.
Where one or both extended-exponent value sets are supported by an implementation, then for each supported extended-exponent value set there is a specific implementation-dependent constant K , whose value is constrained by Table 2.1; this value K in turn dictates the values for E min and E max .
Each of the four value sets includes not only the finite nonzero values that are ascribed to it above, but also the five values positive zero, negative zero, positive infinity, negative infinity, and NaN.
Note that the constraints in Table 2.1 are designed so that every element of the float value set is necessarily also an element of the float-extended-exponent value set, the double value set, and the double-extended-exponent value set. Likewise, each element of the double value set is necessarily also an element of the double-extended-exponent value set. Each extended-exponent value set has a larger range of exponent values than the corresponding standard value set, but does not have more precision.
The elements of the float value set are exactly the values that can be represented using the single floating-point format defined in the IEEE 754 standard, except that there is only one NaN value (IEEE 754 specifies 2 24 -2 distinct NaN values). The elements of the double value set are exactly the values that can be represented using the double floating-point format defined in the IEEE 754 standard, except that there is only one NaN value (IEEE 754 specifies 2 53 -2 distinct NaN values). Note, however, that the elements of the float-extended-exponent and double-extended-exponent value sets defined here do not correspond to the values that can be represented using IEEE 754 single extended and double extended formats, respectively. This specification does not mandate a specific representation for the values of the floating-point value sets except where floating-point values must be represented in the class file format (§4.4.4, §4.4.5).
The float, float-extended-exponent, double, and double-extended-exponent value sets are not types. It is always correct for an implementation of the Java Virtual Machine to use an element of the float value set to represent a value of type float ; however, it may be permissible in certain contexts for an implementation to use an element of the float-extended-exponent value set instead. Similarly, it is always correct for an implementation to use an element of the double value set to represent a value of type double ; however, it may be permissible in certain contexts for an implementation to use an element of the double-extended-exponent value set instead.
Except for NaNs, values of the floating-point value sets are ordered . When arranged from smallest to largest, they are negative infinity, negative finite values, positive and negative zero, positive finite values, and positive infinity.
Floating-point positive zero and floating-point negative zero compare as equal, but there are other operations that can distinguish them; for example, dividing 1.0 by 0.0 produces positive infinity, but dividing 1.0 by -0.0 produces negative infinity.
NaNs are unordered , so numerical comparisons and tests for numerical equality have the value false if either or both of their operands are NaN. In particular, a test for numerical equality of a value against itself has the value false if and only if the value is NaN. A test for numerical inequality has the value true if either operand is NaN.
2.3.3. The returnAddress Type and Values.
The returnAddress type is used by the Java Virtual Machine's jsr , ret , and jsr_w instructions (§ jsr , § ret , § jsr_w ). The values of the returnAddress type are pointers to the opcodes of Java Virtual Machine instructions. Unlike the numeric primitive types, the returnAddress type does not correspond to any Java programming language type and cannot be modified by the running program.
2.3.4. The boolean Type.
Although the Java Virtual Machine defines a boolean type, it only provides very limited support for it. There are no Java Virtual Machine instructions solely dedicated to operations on boolean values. Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java Virtual Machine int data type.
The Java Virtual Machine does directly support boolean arrays. Its newarray instruction (§ newarray ) enables creation of boolean arrays. Arrays of type boolean are accessed and modified using the byte array instructions baload and bastore (§ baload , § bastore ).
In Oracle's Java Virtual Machine implementation, boolean arrays in the Java programming language are encoded as Java Virtual Machine byte arrays, using 8 bits per boolean element.
The Java Virtual Machine encodes boolean array components using 1 to represent true and 0 to represent false .

In the event you adored this article and you wish to acquire guidance with regards to nadex binary options signals service kindly visit our own webpage.

Source: Chapter 2.  The Structure of the Java Virtual Machine

http://binaryoptionsreview.space/?qa=feed&qa_1=qa.rss