summaryrefslogtreecommitdiff
path: root/source/testsoftfloat.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/testsoftfloat.c')
-rw-r--r--source/testsoftfloat.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/source/testsoftfloat.c b/source/testsoftfloat.c
index 70016d7..e60defe 100644
--- a/source/testsoftfloat.c
+++ b/source/testsoftfloat.c
@@ -1,7 +1,7 @@
/*============================================================================
-This C source file is part of TestFloat, Release 3d, a package of programs for
+This C source file is part of TestFloat, Release 3e, a package of programs for
testing the correctness of floating-point arithmetic complying with the IEEE
Standard for Floating-Point, by John R. Hauser.
@@ -895,6 +895,7 @@ int main( int argc, char *argv[] )
const char *argPtr;
unsigned long ui;
long i;
+ int functionMatchAttrib;
/*------------------------------------------------------------------------
*------------------------------------------------------------------------*/
@@ -1100,35 +1101,19 @@ int main( int argc, char *argv[] )
if ( testLoops_forever ) {
fail( "Can test only one function with '-forever' option" );
}
- if ( numOperands == 1 ) {
- for (
- functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
- ) {
- if ( functionInfos[functionCode].attribs & FUNC_ARG_UNARY ) {
- testFunction(
- functionCode,
- roundingPrecision,
- roundingCode,
- tininessCode,
- exactCode
- );
- }
- }
- } else {
- for (
- functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
- ) {
- if (
- functionInfos[functionCode].attribs & FUNC_ARG_BINARY
- ) {
- testFunction(
- functionCode,
- roundingPrecision,
- roundingCode,
- tininessCode,
- exactCode
- );
- }
+ functionMatchAttrib =
+ (numOperands == 1) ? FUNC_ARG_UNARY : FUNC_ARG_BINARY;
+ for (
+ functionCode = 1; functionCode < NUM_FUNCTIONS; ++functionCode
+ ) {
+ if ( functionInfos[functionCode].attribs & functionMatchAttrib ) {
+ testFunction(
+ functionCode,
+ roundingPrecision,
+ roundingCode,
+ tininessCode,
+ exactCode
+ );
}
}
}