Integer square root routine needed.

Mark Brader msb at sq.sq.com
Fri Aug 4 03:35:22 AEST 1989


I would like to remind people that code like
> long sqrt(a)                    /* Integer square root */

does not conform to the proposed ANSI standard, assuming a hosted
environment (which is the usual situation).  The names of all of the
standard library functions are reserved and your program is non-
conforming if it uses any of them for its own purposes.  The solution
is of course to call it lsqrt() or some such name.

We just had this topic once, when someone wanted to define their
own sin() function.

Please, no discussion about the names being reserved; this has been hashed
over many times.

-- 
Mark Brader, SoftQuad Inc., Toronto, utzoo!sq!msb, msb at sq.com
	A standard is established on sure bases, not capriciously but with
	the surety of something intentional and of a logic controlled by
	analysis and experiment. ... A standard is necessary for order
	in human effort.				-- Le Corbusier

This article is in the public domain.



More information about the Comp.lang.c mailing list