procmail
[Top] [All Lists]

Re: multiply by -1

2005-07-07 03:04:41
Dallman Ross:

What's a good method of getting an an inverse value
for an unknown digit?

(1)
     :0
     * VAR ?? ^^-\/[0-9]+
     *$ $MATCH ^ 0
     { VAR = "$=" }
     :0E
     *$ -$VAR ^ 0
     { VAR = "$=" }

(2)  SPC = ' '
     :0  # multiply by -1
     *$ SPC ?? $VAR ^ 1 < -1
     { } VAR = "$="


Scores are integers, so decimals are truncated.

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>