I think Christo Andonyadis wrote:
> 
> I'm using Jess 4.1.
> I get an error when trying to use the "-" operator with negative
> numbers.
> Is this a bug?

Hard to say. WHat error do you get?

> 
> To work around this problem, I am trying to use the abs function to
> convert the negative number to a positive.
> 
> What is wrong with this rule?
> (defrule set_abs
>       (number ?num&:(< ?num 0))
>       =>
>       (assert (abs_num (abs ?num)))
> )


I don't know. Looks fine to me. Does it cause a problem?


Note that some JVMs have faulty versions of the stream tokenization
classes that older versions of Jess used to use (4.1 counts as older,
I think.) These faults could cause problems in parsing negative
numbers and the minus operator. Later versions of Jess work around
these problems by not using these classes. You could try upgrading
your JVM if it's an old one.


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to