Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (N)
Guardian Procedure Calls Reference Manual—522629-013
10-52
NSK_FLOAT_TNS32_TO_IEEE32_ Procedure
NSK_FLOAT_TNS32_TO_IEEE64_ Procedure
The 64-bit TNS floating-point number.
IEEE_Data output
INT .ext:ref NSK_float_ieee64
The 64-bit IEEE floating-point number
Considerations
See Considerations on page 10-47 for description of considerations for this procedure.
Examples
C Example
#include <kfpconv.h>
#include <stdio.h>
void example3(void) {
NSK_float_tns32 before;
NSK_float_ieee32 after;
ReadTNS32(&before); /* read in value to convert */
if( NSK_FLOAT_TNS32_TO_IEEE32_( &before, &after )
& NSK_FLOAT_IEEE_OVERFLOW )
printf( "Overflow!\n");
WriteIEEE32(&after); /* write out result */
}
TAL Example
?nolist
?source $system.system.kfpconv
?list
int(32) proc example4( x );
real(64) .ext x; -- TNS64 before, IEEE64 after
begin
int(32) error;
int .ext before ( NSK_float_tns64 ) = x;
int .ext after ( NSK_float_ieee64 ) = x;
error := NSK_FLOAT_TNS64_TO_IEEE64_( before, after );
if ($int(error) LAND $int(NSK_FLOAT_IEEE_INEXACT)) then
return( 1D ); -- 1 for inexact
return( 0D ); -- 0 for no errors
end;