Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mcnc!ecsvax!utoddl From: utoddl@ecsvax.UUCP (Todd M. Lewis) Newsgroups: comp.lang.c Subject: Integer square root routine needed. Message-ID: <7415@ecsvax.UUCP> Date: 31 Jul 89 13:28:11 GMT Organization: UNC Educational Computing Service Lines: 23 This may be the wrong place to post this, but I need C source to a reasonably fast integer square root routine. (Actually a clear description of an efficient algorithm would do--I can write the code myself.) The wheel I'm inventing is a library of matrix operations for 3-D graphics for Yet Another Ultimate Space Game. I've got everything working with longs, but there's this one place where I just can't seem to get around doing a square root. Right now I'm converting to a double and back, and that works Ok, but I'd rather have no floating point operations. So, How does one efficiently go about taking the square root of a long? Thanks, Todd M. Lewis, utoddl@ecsvax.uncecs.edu, utoddl@ecsvax.bitnet To quote Eugene H. Spafford, "Crisis and Aftermath", Communications of the ACM, vol. 32, no. 6, (June 1989), p. 684: "It is curious that this many people [...] would assume to know the intent of the author based on the observed behavior of the program."