Guardian Procedure Calls Reference Manual
The following table indicates which procedures can produce which errors:
InexactUnderflowOverflowConversion
YESNONOTNS64 to IEEE64
NONONOTNS32 to IEEE64
YESYESYESTNS32 to IEEE32
Considerations
For description of considerations for this procedure, see the NSK_FLOAT_IEEE TO TNS procedures
Considerations (page 876).
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;
880 Guardian Procedure Calls (N)