TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Zack Sessions 76407,1524 (X)
from: James Jones 76257,562
date: 1990-07-08 22:05:17
subject: #4998-still sqrt() problems

#: 5008 S3/Languages
    08-Jul-90  22:05:17
Sb: #4998-still sqrt() problems
Fm: James Jones 76257,562
To: Zack Sessions 76407,1524 (X)

Because C lets you sleaze out and not declare functions, assuming them to
return int.  sqrt() doesn't return an int, it returns a double--so the code
generated for main probably snarfs the least-significant sixteen bits of the
double returned and treats it like an int, which probably gives you a zero.

Either explicitly declare "double sqrt();" or put in the directive "#include
".
{{_

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.