2 ##########################################################################
7 # IeeeCC754 or IEEE 754 Compliance Checker is a precision and range #
8 # independent tool to test whether an implementation of #
9 # floating-point arithmetic (in hardware or software) is compliant #
10 # with the principles of the IEEE 754-854 floating-point standards. #
11 # You can find out more about the testing tool IeeeCC754 at #
13 # http://win-www.uia.ac.be/u/cant/ieeecc754.html #
15 # This tool is in parts based on and greatly benefited from the #
16 # the program FPTEST developed by Jerome Coonen. For a full #
17 # description of the extensions to FPTEST and a reference to #
18 # the original Coonen program, please refer to the URL given above. #
19 # For the options available with the program IeeeCC754 and its #
20 # compatibility with David Hough's hexadecimal UCB format, we #
21 # also refer to the file readme.usage. #
23 # Usage: see readme.usage #
25 # Responsible authors: #
30 # Tarun Agarwal (05-07/2002) #
31 # Johan Bogo (1998-1999) #
32 # Tim Gevers (10-12/2000) #
33 # Debby Ooms (1996-1997) #
34 # Geert Vermuyten (1996-1997) #
35 # Dennis Verschaeren (09/1996-06/2000) #
37 # Copyright (C) 2000 University of Antwerp #
39 # This program can be obtained from the authors, free, but WITHOUT ANY #
40 # WARRANTY; without even the implied warranty of MERCHANTABILITY or #
41 # FITNESS FOR A PARTICULAR PURPOSE. #
44 # Brigitte.Verdonk@uia.ua.ac.be #
45 # Department of Mathematics and Computer Science #
46 # University of Antwerp (UIA) #
47 # Universiteitsplein 1 #
48 # B2610 Antwerp, BELGIUM #
50 ##########################################################################
78 #define NO_FLAGS_INEXACT 16
79 #define NO_FLAGS_OVERFLOW 8
80 #define NO_FLAGS_UNDERFLOW 4
81 #define NO_FLAGS_INVALID 2
82 #define NO_FLAGS_DIV_BY_ZERO 1
86 template<class T> class UCB
91 fstream infile, outfile,logfile;
95 int line,sizeE,sizeM,hidden,dsizeE,dsizeM,dhidden,noFlags,signedZero,ieeeVector;
96 char operation[ 10 ],prec,rounding,compare[ 5 ],exceptions[ 10 ];
97 T operand1,operand2,result;
98 int pre, post; // to accomodate '?'
99 unsigned int errors,warnings,skipped;
101 void PrintError( T &res );
105 int signalu,notsignalu,signalv,signalw,notsignalv,notsignalw,nou,nov,now,allops;
112 int OpenInput( char* filename );
113 int OpenOutput( char* filename );
114 int OpenLogFile( char* filename,int argc,char **argv );
115 int ReadLine( char* str=NULL,int sZero=1, int nflags=0,int *lines=NULL );
117 char* GetOperation( );
118 char GetPrecision( );
121 char* GetExceptions( );
126 char* DoLine( int tiny,int inf, int nan);
127 void Compare ( T &reslt );
128 void Close( int tiny );
136 /* result.SetEnvironment(); change BV */
159 int UCB<T>::OpenInput( char* filename )
161 infile.open( filename,ios::in );
162 if ( infile.good( ) )
169 void UCB<T>::Close( int tiny )
171 logfile << "Summary: " << endl;
172 logfile << "-------- " << endl;
174 if ( tiny ) { /* conclusion underflow */
178 logfile << "Warning: only 'w' underflow cases in the testset" << endl;
181 logfile << "Warning: only 'v' underflow cases in the testset" << endl;
183 logfile << "Warning: only 'v' and 'w' underflow cases in the testset" << endl;
188 logfile << "Warning: no special 'v' or 'w' underflow cases in the testset" << endl;
189 if ( ucb.signalu && !ucb.notsignalu )
190 logfile << "Implementation signals underflow in case the result" << endl << "(1) is tiny after rounding and" << endl << "(2) suffers denormalization loss" << endl << "('u' - underflow)" << endl;
192 logfile << "Warning: no special 'v' underflow cases in the testset" << endl;
195 logfile << "Warning: no special 'w' underflow cases in the testset" << endl;
196 if ( ( ucb.signalu && !ucb.notsignalu ) && ( ucb.signalv && !ucb.notsignalv ) )
197 logfile << "Implementation signals underflow in case the result" << endl << "(1) is tiny after rounding and" << endl << "(2) raises the inexact exception" << endl << "('v' - underflow)" << endl;
198 } else if ( ucb.signalu && !ucb.notsignalu ) {
199 if ( ucb.signalw && !ucb.notsignalw )
200 logfile << "Implementation signals underflow in case the result" << endl << "(1) is tiny before rounding and" << endl << "(2) raises the inexact exception" << endl << "('w' - underflow)" << endl;
201 else if ( ucb.signalv && !ucb.notsignalv )
202 logfile << "Implementation signals underflow in case the result" << endl << "(1) is tiny after rounding and" << endl << "(2) raises the inexact exception"<< endl << "('v' - underflow)" << endl;
204 logfile << "Implementation signals underflow in case the result" << endl << "(1) is tiny after rounding and" << endl << "(2) suffers denormalization loss" << endl << "('u' - underflow)" << endl;
210 logfile << "Errors: " << errors << "/" << allops << endl;
211 logfile << "Warnings: " << warnings << "/" << allops << endl;
212 logfile << "Skipped: " << skipped << "/" << allops << endl;
216 int UCB<T>::OpenOutput( char* filename )
218 outfile.open( filename,ios::out );
219 if ( outfile.good( ) )
226 int UCB<T>::OpenLogFile( char* filename,int argc, char **argv )
228 logfile.open( filename,ios::out );
229 if ( logfile.good( ) ) {
230 logfile << "Testrun: ";
231 for ( int i = 0; i < argc;i++ )
232 logfile << argv[ i ] << " ";
233 logfile << endl << endl << flush;
241 int UCB<T>::ReadLine( char* str,int sZero,int nflags,int *lines )
243 int i,j,k,gotInput=0,count;
245 Bitstring tmpbitstring,tmpbitstring2;
246 char buf[ BUF_LEN ],tmp[ FP_STR ];
252 if ( !infile.eof( ) ) {
253 infile.getline( buf,BUF_LEN );
254 if( strlen( buf ) !=0 )
261 strncpy( buf,str,strlen( str ) );
270 while ( buf[ i ] != ' ' ) {
271 operation[ i ] =buf[ i ];
275 operation[ i ] ='\0';
277 if ( !isdigit( operation[ strlen( operation ) -1 ] ) ) {
278 prec= operation[ strlen( operation ) -1 ];
279 operation[ strlen( operation ) -1 ] ='\0';
344 ieeeVector=0; /* Cannot be ieeeVector! */
348 while ( isdigit( buf[ i ] ) ) i--; /* rewind */
351 operation[ i ] = '\0'; /* ignore digit after operation */
354 while ( buf[ i ] != ' ' )
355 tmp[ j++ ] =buf[ i++ ];
360 while ( buf[ ++i ] == ' ' );
364 while ( buf[ i ] != ' ' )
365 tmp[ j++ ] =buf[ i++ ];
368 hidden = atoi( tmp );
370 while ( buf[ ++i ] == ' ' );
374 while ( buf[ i ] != ' ' )
375 tmp[ j++ ] =buf[ i++ ];
379 sizeM++ ; /* +1 for the sign */
382 while ( buf[ i ] == ' ' ) i++;
384 /* read destination format */
385 if ( ( strncmp( operation,"rt",2 ) == 0 ) || ( strncmp( operation,"ct",2 ) == 0 ) ) {
386 if ( !isdigit( buf[ i ] ) ) {
403 // cout << 'l' << endl;
418 while ( buf[ i ] == ' ' ) i++;
423 while ( buf[ i ] != ' ' )
424 tmp[ j++ ] =buf[ i++ ];
426 dsizeE = atoi( tmp );
428 while ( buf[ ++i ] == ' ' );
431 while ( buf[ i ] != ' ' )
432 tmp[ j++ ] = buf[ i++ ];
434 dhidden = atoi( tmp );
436 while ( buf[ ++i ] == ' ' );
439 while ( buf[ i ] != ' ' )
440 tmp[ j++ ] =buf[ i++ ];
442 dsizeM = atoi( tmp );
447 while ( buf[ i ] == ' ' ) i++;
457 while ( buf[ ++i ] == ' ' );
461 while ( buf[ i ] != ' ' )
462 compare[ j++ ] =buf[ i++ ];
466 while ( buf[ ++i ] == ' ' );
469 while ( buf[ i ] != ' ' ) {
470 exceptions[ j++ ] =buf[ i++ ];
471 exceptions[ j++ ] =' ';
473 exceptions[ j ] ='\0';
475 while ( buf[ ++i ] == ' ' );
477 if ( ( strncmp( operation,"ci",2 ) ==0 ) ||
478 ( strncmp( operation,"cu",2 ) ==0 ) ) {
479 count = 32; /* 32 bit integer */
480 i += 2; /* avoid 0x */
482 for ( j=0; j<count;j++ ) {
483 if ( isdigit( buf[ i ] ) || ( ( buf[ i ] >= 'a' ) && ( buf[ i ] <= 'f' ) ) )
484 tmp[ j ] = buf[ i++ ];
491 for ( ; j<count;j++ )
494 } else if ( ( strncmp( operation,"cI",2 ) ==0 ) ||
495 ( strncmp( operation,"cU",2 ) ==0 ) ) {
496 count = 64; /* 64 bit integer */
497 i += 2; /* avoid 0x */
498 for ( j=0; j<count;j++ ) {
499 if ( isdigit( buf[ i ] ) || ( ( buf[ i ] >= 'a' ) && ( buf[ i ] <= 'f' ) ) )
500 tmp[ j ] = buf[ i++ ];
506 for ( ; j<count;j++ )
509 } else if ( strncmp( operation,"d2b",3 ) == 0 ) {
511 while ( buf[ i ] != ' ' ) {
512 tmp[ j++ ] = buf[ i++ ];
516 count =( int ) ceil( ( double ) ( sizeM+sizeE ) /32.0 ) *8;
517 for ( j=0; j<count ;j++ ) {
518 if ( buf[ i ] ==' ' )
520 tmp[ j ] = buf[ i++ ];
525 if ( strncmp( operation,"d2b",3 ) == 0 ) {
526 operand1 = T( sizeM-1, sizeE, hidden ); /* sets Mantissa and exp right */
527 operand1.decimal = new char[ maxstr ];
528 for ( k = 0; k <= j; k++ )
529 operand1.decimal[ k ] = tmp[ k ];
530 operand1.decimal[ k ] = '\n';
531 } else if ( strncmp( operation,"ci",2 ) ==0 ) {
532 tmphex.StringToBitstr( tmp );
533 operand1 = T( tmphex,32,0,0 );
534 } else if ( strncmp( operation,"cu",2 ) ==0 ) {
535 tmphex.StringToBitstr( tmp );
536 operand1 = T( tmphex,32,0,0 );
537 } else if ( strncmp( operation,"cI",2 ) ==0 ) {
538 tmphex.StringToBitstr( tmp );
539 operand1 = T( tmphex,64,0,0 );
540 } else if ( strncmp( operation,"cU",2 ) ==0 ) {
541 tmphex.StringToBitstr( tmp );
542 operand1 = T( tmphex,64,0,0 );
544 tmphex.StringToBitstr( tmp );
545 operand1 = T( tmphex,sizeM-1,sizeE,hidden );
549 count =( int ) ceil( ( double ) ( sizeM+sizeE ) /32.0 ) *8; /* reset count! */
551 for ( j=0; j<count ;j++ ) {
552 if ( buf[ i ] ==' ' )
554 tmp[ j ] = buf[ i++ ];
558 tmphex.StringToBitstr( tmp );
559 operand2 = T( tmphex,sizeM-1,sizeE,hidden );
561 if ( buf[ i+1 ] == '?' ) {
564 if ( ( strncmp( operation,"ri",2 ) ==0 ) ||
565 ( strncmp( operation,"ru",2 ) ==0 ) ) {
566 count = 32; /* 32 bit integer */
567 i += 3; /* avoid 0x */
568 for ( j=0; j<count;j++ ) {
569 if ( isdigit( buf[ i ] ) || ( ( buf[ i ] >= 'a' ) && ( buf[ i ] <= 'f' ) ) )
570 tmp[ j ] = buf[ i++ ];
576 for ( ; j<count;j++ )
579 else if ( ( strncmp( operation,"rI",2 ) ==0 ) ||
580 ( strncmp( operation,"rU",2 ) ==0 ) ) {
581 count = 64; /* 64 bit integer */
582 i += 3; /* avoid 0x */
583 for ( j=0; j<count;j++ ) {
584 if ( isdigit( buf[ i ] ) || ( ( buf[ i ] >= 'a' ) && ( buf[ i ] <= 'f' ) ) )
585 tmp[ j ] = buf[ i++ ];
591 for ( ; j<count;j++ )
593 } else if ( strncmp( operation,"b2d",3 ) == 0 ) {
596 while ( buf[ i ] != '\n' ) {
597 tmp[ j++ ] = buf[ i++ ];
600 count =( int ) ceil( ( double ) ( dsizeM+dsizeE ) /32.0 ) *8;
602 for ( j=0; j<count ;j++ ) {
603 if ( buf[ i ] ==' ' )
605 tmp[ j ] = buf[ i++ ];
611 if ( strncmp( operation,"b2d",3 ) == 0 ) {
612 result.decimal = new char[ maxstr ];
613 for ( k = 0; k <= j; k++ )
614 result.decimal[ k ] = tmp[ k ];
615 result.decimal[ k ] = '\0';
618 else if ( strncmp( operation,"ri",2 ) ==0 ) {
619 tmphex.StringToBitstr( tmp );
620 result = T( tmphex,32,0,0 );
621 } else if ( strncmp( operation,"ru",2 ) ==0 ) {
622 tmphex.StringToBitstr( tmp );
623 result = T( tmphex,32,0,0 );
624 } else if ( strncmp( operation,"rI",2 ) ==0 ) {
625 tmphex.StringToBitstr( tmp );
626 result = T( tmphex,64,0,0 );
627 } else if ( strncmp( operation,"rU",2 ) ==0 ) {
628 tmphex.StringToBitstr( tmp );
629 result = T( tmphex,64,0,0 );
631 tmphex.StringToBitstr( tmp );
632 result = T( tmphex,dsizeM-1,dsizeE,dhidden );
642 char* UCB<T>::GetOperation( )
648 char UCB<T>::GetPrecision( )
654 char UCB<T>::GetRounding( )
660 char* UCB<T>::GetCompare( )
666 char* UCB<T>::GetExceptions( )
672 T & UCB<T>::GetOperand1( )
678 T & UCB<T>::GetOperand2( )
684 T & UCB<T>::GetResult( )
690 char* UCB<T>::DoLine( int tiny,int inf, int nan)
695 if ( !( tiny ) && ( operand1.istiny( ) || operand2.istiny( ) || result.istiny( ) ) )
696 return NULL; /* do not test tiny denormalized numbers */
697 else if ( !( inf ) && ( operand1.isInf( ) || operand2.isInf( ) || result.isInf( ) ) )
698 return NULL; /* do not test infinities */
699 else if ( !( nan ) && ( operand1.isNan( ) || operand2.isNan( ) || result.isNan( ) ) )
700 return NULL; /* do not test NaNs */
701 /* logstream.seekp(0,ios::beg); */
705 result.ClearFPEnvironment( );
707 #ifdef BasicOperations
708 if ( strncmp( operation,"add",3 ) ==0 )
709 res = operand1 + operand2;
710 else if( strncmp( operation,"sub",3 ) ==0 )
711 res = operand1 - operand2;
712 else if( strncmp( operation,"mul",3 ) ==0 )
713 res = operand1 * operand2;
714 else if( strncmp( operation,"div",3 ) ==0 )
715 res = operand1 / operand2; /* debug */
716 else if( strncmp( operation,"rem",3 ) ==0 )
717 res = operand1 % operand2;
718 else if( strncmp( operation,"sqrt",4 ) ==0 )
719 res = operand1.sqrt( );
723 if ( strncmp( operation,"rt",2 ) ==0 )
724 res = operand1.roundto( dsizeE,dsizeM-1,dhidden );
725 else if ( strncmp( operation,"ct",2 ) ==0 )
726 res = operand1.copyto( dsizeE,dsizeM-1,dhidden );
727 else if ( strncmp( operation,"i",1 ) ==0 )
728 res = operand1.rint( );
729 else if ( strncmp( operation,"ri",2 ) ==0 )
730 res = operand1.ri( );
731 else if ( strncmp( operation,"ru",2 ) ==0 )
732 res = operand1.ru( );
733 else if ( strncmp( operation,"rI",2 ) ==0 )
734 res = operand1.rI( );
735 else if ( strncmp( operation,"rU",2 ) ==0 )
736 res = operand1.rU( );
737 else if ( strncmp( operation,"ci",2 ) ==0 )
738 res = operand1.ci( dsizeE,dsizeM-1,dhidden );
739 else if ( strncmp( operation,"cu",2 ) ==0 )
740 res = operand1.cu( dsizeE,dsizeM-1,dhidden );
741 else if ( strncmp( operation,"cI",2 ) ==0 )
742 res = operand1.cI( dsizeE,dsizeM-1,dhidden );
743 else if ( strncmp( operation,"cU",2 ) ==0 )
744 res = operand1.cU( dsizeE,dsizeM-1,dhidden );
745 else if ( strncmp( operation,"b2d",3 ) ==0 ) {
747 while ( result.decimal[ i ] != 'E' ) {
750 if ( result.decimal[ 0 ] == '+' || result.decimal[ 0 ] == '-' )
753 res = operand1.b2d( i );
755 else if ( strncmp( operation,"d2b",3 ) ==0 ) {
756 res = operand1.d2b( );
758 #if defined(IntelPentium) && defined(NONE_TEST) && defined(Conversions)
759 else if( strncmp( operation,"rem",3 ) ==0 )
760 res = operand1 % operand2;
761 else if( strncmp( operation,"sqrt",4 ) ==0 )
762 res = operand1.sqrt( );
772 void UCB<T>::PrintError( T &res )
775 if ( (!ieeeVector) || (ieee) )
776 errors++; /* total number of errors encountered */
779 logfile<<"Operation: " << operation << endl;
780 switch ( rounding ) {
782 logfile<<"Round to nearest" << endl;
785 logfile<<"Round to zero" << endl;
788 logfile<<"Round up" << endl;
791 logfile<<"Round down" << endl;
794 logfile<<"Operand 1: " << operand1 << endl;
795 logfile<<"Operand 2: " << operand2 << endl;
796 logfile<< "Flags expected: ";
797 for( i=0 ; i < strlen( exceptions );i++ )
798 switch ( exceptions[ i ] ) {
822 logfile <<"Flags returned: ";
823 if ( res.GetFPDivByZero( ) )
825 if ( res.GetFPInvalid( ) )
827 if ( res.GetFPInexact( ) )
829 if ( res.GetFPOverflow( ) )
831 if ( res.GetFPUnderflow( ) ) {
835 logfile << "Correct result: " << result << endl;
836 logfile << "Returned result: " << res << endl<< endl;
841 void UCB<T>::Compare ( T &reslt )
843 unsigned int i,check=1;
844 if ( ( noFlags & NO_FLAGS_DIV_BY_ZERO ) == 0 ) {
845 if( reslt.GetFPDivByZero( ) )
846 if( !strchr( exceptions,'d' ) ) {
847 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") << "Line "<<line<< ": divide by zero not expected"<<endl;
852 if ( ( noFlags & NO_FLAGS_INVALID ) == 0 ) {
853 if( reslt.GetFPInvalid( ) )
854 if( !strchr( exceptions,'v' ) ) {
855 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": invalid not expected "<<endl;
860 if ( ( noFlags & NO_FLAGS_INEXACT ) == 0 ) {
861 if( reslt.GetFPInexact( ) )
862 if( !strchr( exceptions,'x' ) ) {
863 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": inexact not expected"<<endl;
868 if ( ( noFlags & NO_FLAGS_OVERFLOW ) == 0 ) {
869 if( reslt.GetFPOverflow( ) )
870 if( !strchr( exceptions,'o' ) ) {
871 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": overflow not expected"<<endl;
876 if ( ( noFlags & NO_FLAGS_UNDERFLOW ) == 0 ) {
877 if( reslt.GetFPUnderflow( ) )
878 if( !strchr( exceptions,'u' ) ) {
879 if( strchr( exceptions,'a' ) ) {
882 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": underflow without denormalization loss previously not detected"<< endl;
886 else if ( strchr( exceptions,'b' ) ) {
889 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": underflow without denormalization loss previously not detected" << endl;
892 logfile <<((ieeeVector) && !(ieee) ? "Warning " : "Error ")<<"Line "<<line<< ": underflow before rounding previously not detected"<< endl;
897 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": underflow not expected"<<endl;
905 for( i=0 ; i < strlen( exceptions );i++ ) {
906 switch ( exceptions[ i ] ) {
908 if ( ( noFlags & NO_FLAGS_INEXACT ) == 0 ) {
909 if( !reslt.GetFPInexact( ) ) {
910 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": inexact flag not returned"<<endl;
916 if ( ( noFlags & NO_FLAGS_OVERFLOW ) == 0 ) {
917 if( !reslt.GetFPOverflow( ) ) {
918 logfile <<((ieeeVector) && !(ieee) ? "Warning " : "Error ")<<"Line "<<line<< ": overflow flag not returned"<<endl;
925 if ( ( noFlags & NO_FLAGS_UNDERFLOW ) == 0 ) {
926 if( !reslt.GetFPUnderflow( ) ) {
927 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": underflow not returned"<<endl;
935 if ( ( noFlags & NO_FLAGS_UNDERFLOW ) == 0 ) {
936 if( !reslt.GetFPUnderflow( ) ) {
938 /* PrintError(reslt); */
948 if ( ( noFlags & NO_FLAGS_UNDERFLOW ) == 0 ) {
949 if( !reslt.GetFPUnderflow( ) ) {
952 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": underflow before rounding previously detected"<< endl;
960 if ( ( noFlags & NO_FLAGS_INVALID ) == 0 ) {
961 if( !reslt.GetFPInvalid( ) ) {
962 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": invalid flag not returned"<<endl;
968 if ( ( noFlags & NO_FLAGS_DIV_BY_ZERO ) == 0 ) {
969 if( !reslt.GetFPDivByZero( ) ) {
970 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": divide flag not returned"<<endl;
977 if ( !pre ) { // no '?'
978 if ( result.decimal != NULL ) {
979 if ( strcmp( result.decimal,reslt.decimal ) != 0 ) {
980 int rd=0, rdd=0, epos=-100;
981 char *resultdummy=new char[maxstr];
982 while (result.decimal[rd] != '\0')
984 if ((rd==epos+1) && result.decimal[rd]!='-')
985 resultdummy[rdd++]='+';
987 resultdummy[rdd] = result.decimal[rd];
989 if (result.decimal[rd] == 'E')
994 resultdummy[rdd] = '\0';
996 if (strcmp(resultdummy, reslt.decimal) != 0)
998 logfile <<((ieeeVector) && !(ieee) ? "Warning " : "Error ") << "Line "<<line<< ": different decimal representation"<< endl;
1001 delete[] resultdummy;
1003 } else if ( result.IsNaN( ) ) {
1004 if( !reslt.IsNaN( ) ) {
1006 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line : "<< line << ": result is not a NaN"<<endl;
1009 if ( reslt.sizeExp > 0 ) {
1010 if ( result.Sign( ) != reslt.Sign( ) ) {
1011 if (!result.IsZero( ) ) {
1012 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": Different sign"<< endl;
1015 else if ( signedZero ) {
1016 /* In this case result is a zero and there is signedzero */
1017 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") <<"Line "<<line<< ": Different sign"<< endl;
1021 if ( result.GetExponent( ) != reslt.GetExponent( ) ) {
1022 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") << "Line "<<line<< ": exponent different" << endl;
1026 if( result.GetMantissa( ) != reslt.GetMantissa( ) ) {
1027 logfile<<((ieeeVector) && !(ieee) ? "Warning " : "Error ") << "Line "<<line<< ": mantissa different" << endl;
1033 PrintError( reslt );
1037 void UCB<T>::SetFPRound( )
1039 switch ( rounding ) {
1041 result.SetFPRound( RM_NEAR );
1044 result.SetFPRound( RM_ZERO );
1047 result.SetFPRound( RM_UP );
1050 result.SetFPRound( RM_DOWN );