TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KURT J. TISCHER
from: DAN MCGREGOR
date: 1997-07-08 14:23:00
subject: Signs of numbers

 KJT>        Does Visual C++ have a similar function?  If 
 KJT> so, in what header file is it located and what is the name of the  KJT> 
function?  If not, would someone please show me a function to determine  KJT> 
the sign of a number which would return 1 if positive, 0 if zero, and -1  
KJT> if negative...?
A sign of a number is easy to get at in C++.  Use the operators,  and == 
to figure out a sign of a number.  Something like this:
if (number > 0)
        
if (number < 0)
        
if (number == 0)
        
--- Maximus 3.01
---------------
* Origin: The Dragons Cave -- 2am - 5am CST (1:140/237.2)

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