| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | RE: Signs of numbers |
On , Miguel Angel Scapolla (4:90/90@fidonet) wrote:
> Or implement this function via macro definition:
> #define SIGN(x) (((x) > 0) ? 1 : (((x) < 0) ? -1 : 0))
> And use this:
> int z = SIGN (y);
Miguel...
As previously noted, this is an usafe macro. Consider what happens when you
do somtehing like...
int z = SIGN(y++);
...Some of the time, y will be incremented once, sometimes twice.
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6) |
|
| 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™.