Ray Gardiner wrote: > A quick and dirty check is as follows... > This a trick, which i believe relates back to the abacus days where > you multiply 12345679 by any two numbers adding to 9 and you will get > a repeating digit. > > ie: 12345679 * 18 = 222222222 and > 12345679 * 27 = 333333333 etc... Cool, but perhaps more intuitive if you make a few simplifications. First, the "any two numbers adding to 9" statement implies that the multiplier is divisible by 9. In other words, if you have a two digit decimal number: ab = a*10 + b and (a + b) mod 9 = 0 then (a*10+b) mod 9 = 0 "proof": ab = a*10 + b = a*9 + (a + b) Since a is an integer, a*9 is divisible by 9. And so if ab is divisible by 9 then (a+b) is divisible by 9. This concept is also extendable to multidigit decimal numbers. And this is why Bill Westfield wrote Ray's trick as: 12345679 * d*9 = ddddddddd Next, multiply the 9 and 12345679: 12345679 * d * 9 = 111111111 * d I doubt this will be useful for testing 64bit math routines though. One perhaps obvious way to simplify the testing is to pair inverse operations. I.e. multiplication with division and addition with subtraction. Then you can do things like compute z = x*y and then check that z/x == y etc. This could save the arduous task of having to pre-compute a bunch of stuff. This also tacitly assumes that double errors don't nullify one another. Lou Calkins asked: > I just don't want my epitaph to > read "this man got 14% through a total test of the divide routine". :-) > Any suggestions? RIP? Scott