NonStop Server for Java 5.1 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 5.1 shows how to create a native
library.
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 5.1, 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
Double-Precision Values
For double-precision values, TNS floating-point representations have smaller exponents (and therefore, a smaller
range) than IEEE floating-point representations, but they are more precise, as the following table shows: