NonStop Server for Java Programmer's Reference (NSJ 4.2+)
system property.
Linker and Compiler Options
Compiler Options
When you compile C++ source for use with NonStop Server for Java 4, you must use the following compiler
option to identify which dialect of the C++ compiler is to be used:
-Wversion3
Because NonStop Server for Java 4 does not support DLLs, never use the -Wcall_shared to compile JNI code.
In addition, for a compilation unit containing JNI code that has any floating-point parameters being passed across
the JNI boundary and that is directly called by the JVM, you must use the compiler option:
-WIEEE_float
Any compilation units not called directly by the JVM can be compiled without the –WIEEE_float option;
however, the complications that can occur while using such mixed modes are beyond the scope of this document.
However, the javahjni demo shows an example of mixed modes. (For information on demos, see
Demonstration Programs.)
Linker Options
When building native libraries, you must use the following linker option:
–set floattype IEEE_float
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