Where ?b is a negative integer,
the error I get on the (abs ?b) call is:
Rete Exception in routine Value::Value while executing defrule
set_abs_et.
  Message: not a float type: type = 0 at line 0:  ( run ) .

the error I get on the (- ?a ?b)  is:
Rete Exception in routine Value::Value while executing defrule
time_between.
  Message: not a float type: type = 4 at line 0:  ( run ) .

I was hoping I had the syntax wrong. 
There is no problem using the "+" operator with negative numbers, 
only the "-" and apparently the abs function. 
The fact that (+ ?a ?b) where ?b is negative works but that (- ?a ?b)
does not 
made me think that it was a bug in Jess.
If I don't use varaibles the minus works i.e. (- 10 -5) gives 15.

Thanks
Christo

Dr. Ernest J. Friedman-Hill wrote:
> 
> 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]
> ---------------------------------------------------------------------
---------------------------------------------------------------------
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