[pstricks] Testing a number

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Jun 18 08:47:23 CEST 2008


John Smith schrieb:
> Is there a way to test is a number is zero, positive or negative? I tried this using the FP package as follows.
>  
> \def\test#1{\FPifzero{#1} 0 \else \FPifpos{#1} 1 \else -1 \fi \fi}
>  
> It works if the number is positive or negative but gives a Tex error about an extra \fi if the input is zero.

giv an example in which case do you need such a test.

Herbert



More information about the PSTricks mailing list