[pstricks] Testing a number

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Jun 18 09:50:14 CEST 2008

John Smith schrieb:
>> giv an example in which case do you need such a test.

 > I want the macro to return numbers as follows.
 > \test{0} -> 0\test{1.234} -> 1\test{-1.234} -> -1
 > I need to know the sign of the number because it influences
 > whether I draw a vector (if number is not equal to zero) and
 > in which direction it points. Thanks.


\def\test#1{\expandafter\test at i#1..\@nil}
\def\test at i#1.#2.\@nil{#1}





More information about the PSTricks mailing list