NonStop Server for Java 4.2 Programmer's Reference
Linker Options
When building native libraries, you must use the following linker option:
–set floattype IEEE_float
How to Create Your Own Library of Native Code
The javahjni demonstration program that comes with NonStop Server for Java 4 shows an example of a user
Makefile that builds a library file from user source code. For TNS/R, this example uses the Nonstop Server for
Java 4 Makefile to build a new java executable with the user's native code linked in.
For information about the NonStop Server for Java 4 Makefile, see Using the Makefile to Link in Native Libraries
(TNS/R Only).
You can find the javahjni demonstration program in the
install-dir/demo/javahjni directory.
IEEE Floating-Point Implementation
Java uses IEEE floating-point arithmetic.
Note: In NonStop Server for Java 4, you cannot specify whether your Java classes use TNS format.
Incompatibilities between the IEEE floating point and TNS floating-point representations might cause loss of
precision or accuracy when you convert between TNS float or double and IEEE float or double.
This subsection explains the following subjects:
Floating-Point Values●
Double-Precision Values●
How to Call TNS Floating-Point Functions from JNI Code●
Floating-Point Values
For floating-point values, TNS floating-point representations have larger exponents (and therefore, a larger range)
than IEEE floating-point representations, but they are less precise, as the following table shows:
Floating-Point
Representation
Minimum Positive
Decimal Value
Maximum Decimal
Value
TNS 1.7272337e-77F 1.1579208e77F
IEEE 1.40239846e-45F 3.40282347e+38F