NonStop Server for Java 7.0 Programmer's Reference

Double-precision values
For double-precision values, TNS floating-point representations have smaller exponents (hence a
smaller range) than IEEE floating-point representations, but they are more precise, which is
demonstrated in Table 6 (page 40):
Table 6 Double-precision ranges
Maximum decimal valueMinimum positive decimal valueFloating-Point representation
1.15792089237316192e771.7272337110188889e-77TNS
1.79769313486231570e+308/4.94065645841246544e-324IEEE
Calling TNS floating-point functions from JNI code
This section describes the procedure to call a TNS floating-point function from an IEEE floating-point
function.
Perform the following when using TNS floating-point compiled functions in native code linked in
the java executable:
Do not call the Common Runtime Environment (CRE) functions with TNS floating-point values
because CRE functions are expecting IEEE floating-point values.
Do not pass floating-point values (float and double) across mixed float compilation units.
When passing or returning floating-point values between IEEE floating-point compiled functions
and TNS floating-point compiled functions, pass or return the following:
A float as one of the 32–bit structures defined in $SYSTEM.SYSTEM.KFPCONVH
(NSK_float_ieee32, NSK_float_tns32) or /usr/include/kfpconv.h.
A double as one of the 64–bit structures defined in $SYSTEM.SYSTEM.KFPCONVH
(NSK_float_ieee64, NSK_float_tns64) or /usr/include/kfpconv.h.
You can call a native function that accepts or returns a TNS float or double value if you
create an intermediate function. The intermediate function assembles between the IEEE
floating-point compiled JNI method that the JVM calls and the native function that accepts or
returns the float or double value.
Either the JNI method or intermediate method can be responsible for calling one of the
NSK_float_* procedures to convert between IEEE and TNS floating-point formats.
The intermediate function:
Is compiled with TNS floating-point.
Accepts float and double arguments as one of the special structures defined in the
$SYSTEM.SYSTEM.KFPCONVH or /usr/include/kfpconv.h file.
Calls the TNS compiled native function passing TNS float or double arguments.
Converts any float or double return value to an IEEE floating-point value, which the
JNI caller expects.
Returns the float or double in one of the special structures defined in the
$SYSTEM.SYSTEM.KFPCONVH or /usr/include/kfpconv.h file.
For an example, see javahjni “Demonstration programs” (page 28).
Multi-threaded programming
The Java virtual machine for the NSJ7 is multi-threaded and uses POSIX User Thread (PUT) library,
which conforms to the IEEE POSIX Standard 1003.1, 2004. Threads are scheduled for execution
by PUT library and not by operating system. All threads created within a process share the same
40 Implementation specifics