TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KURT J. TISCHER
from: RAJESH DHAWAN
date: 1997-07-20 19:14:00
subject: Signs of numbers

Hi Kurt::
  Kurt J. Tischer,
  In a message on 8 July, wrote :
KJT> would someone
KJT> please show me a function to determine the sign of a number which would
KJT> return 1 if positive, 0 if zero, and -1 if negative...?
Sure,
/*********************************/
int mySign(int num)
{
 if (num>0) return 1;
 if (num<0) return -1;
 return 0;
}
/**********************************/
Bye
Rajesh  
...
 * ATP/Linux 1.42 * TV advertising is the rattling inside a swill bucket.
--- Maximus/2 3.01
---------------
* Origin: Kalptaru Net India. http://www.kalptaru.com . (6:606/31)

SOURCE: echomail via exec-pc

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™.