 Timestamp:
 Mar 31, 1998, 12:23:59 PM (26 years ago)
 Branches:
 (u'spielwiese', '2fa36c576e6a4ddbb1093b43c7f8e9835e17e52a')
 Children:
 847ebddd2a19445d1f5f58aa9aae2175e2ba965c
 Parents:
 cc94b0aa665105d616f94ce4f3c3cd02b336adca
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/ftest/fbinops.m4
rcc94b0a rbc82d6 1 1 /* emacs edit mode for this file is * C++ * */ 2 /* $Id: fbinops.m4,v 1. 3 19971217 12:16:40schmidt Exp $ */2 /* $Id: fbinops.m4,v 1.4 19980331 10:23:59 schmidt Exp $ */ 3 3 4 4 ftestSetNameOfGame( fbinops, `" … … 7 7 8 8 The following operators (with aliases) are recognized: 9 `+', `', `*' (= `mul'), `/', ` %': return a canonicalform;9 `+', `', `*' (= `mul'), `/', `div', `%', `mod': return a canonicalform; 10 10 `==', `!=', `<' (= `lt'), `>' (= `gt'): return an integer (i.e. boolean) 11 11 "'`' ) … … 157 157 return UndefinedResult; 158 158 } 159 160 static ftestStatusT 161 ftestDivideTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & quot ) 162 { 163 if ( ! ((quot*g)+(f%g)f).isZero() ) { 164 ftestError( CheckError, "f != (f/g)*g+(f%%g)\n" ); 165 return Failed; 166 } else 167 return Passed; 168 } 169 170 static ftestStatusT 171 ftestDivTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & quot ) 172 { 173 if ( ! (f%g).isZero() ) { 174 ftestError( CheckError, "g does not divide f\n" ); 175 return Failed; 176 } else if ( f != (quot*g) ) { 177 ftestError( CheckError, "f != (div(f, g)*g)\n" ); 178 return Failed; 179 } else 180 return Passed; 181 } 182 183 static ftestStatusT 184 ftestModuloTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & rem ) 185 { 186 if ( ! (((f/g)*g)+(rem)f).isZero() ) { 187 ftestError( CheckError, "f != (f/g)*g+(f%%g)\n" ); 188 return Failed; 189 } else 190 return Passed; 191 } 159 192 //}}} 160 193 … … 171 204 { &operator*, ftestArithTest, "*", "f*g" }, 172 205 { &operator*, ftestArithTest, "mul", "f*g" }, 173 { &operator/, ftestArithTest, "/", "f/g" }, 174 { &operator%, ftestArithTest, "%", "f%g" }, 206 { &operator/, ftestDivideTest, "/", "f/g" }, 207 { &div, ftestDivTest, "div", "div(f,g)" }, 208 { &operator%, ftestModuloTest, "%", "f%g" }, 209 { &mod, ftestModuloTest, "mod", "mod(f,g)" }, 175 210 { 0, 0, 0, 0 } 176 211 };
Note: See TracChangeset
for help on using the changeset viewer.