sig() -- return the sign of its argument
Return +1, -1 or 0, if the single argument is positive, negative or zero.
//*** requires ncurses support compiled in ***
//See Documentation/Advanced for info.
print color(c$(2+sig(num))) num
This program prints an infinite sequence of random number; positive numbers are printed in green, negative numbers are printed red (an exact zero would be printed white). (With a little extra work, this program could be easily extended into a brogerage system).
Start this program in a terminal.
abs, int, frac