>From the description of the "long" function in the Jess manual:
"Longs in Jess are "second class citizens" in that you can't directly do math on them. You can assign them to variables, pass them to function calls, and convert them to Strings or floating-point numbers." Promoting the type RU.LONG to be a first-class type was originally slated to be done in 6.1, but it didn't happen. Instead, this will be a feature for Charlemagne. In the meantime, this workaround is as good as any. I think Mitch Christensen wrote: > Hey, > > I noticed that the math functions (+,-,/,*,etc.) all return integer > values unless either parameter is a float, then it returns a float. I > have a slot value, defined as a long, such that the following, > > (< ?longVal (- ?longVal2 10000)) > > never returns true (even when it should be true). I understand that > this is due to the loss in precision during the long-to-integer > conversion, and I am able to make it work as follows, > > (< (float ?longVal) (- (float ?longVal2) (float 10000))) > > My question is this the "best" way to deal with this scenario? > > -Mitch --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
