Jess uses Integer.parseInt and Double.parseDouble() to parse numbers;
when it sees a symbol that starts with a number, it tries to use
parseInt, and if that fails, it tries parseDouble, and if that fails,
it just leaves it as a symbol.
So the syntax is that accepted by these functions; in particular,
trailing D and F, as well as scientific notation XeY, are
accepted. The manual should be revised to reflect this. Thanks.
I think Ryan wrote:
> Hello,
>
> One of my coworkers found an issue when asserting facts. When asserting a
> numbers with a D or F ending without quotes results in an asserted decimal
> value (see below). My guess is that D are F are Decimal, Floating
> respectively. Anyway, why is this? Are there any other protected
> characters I should know about?
>
> Thanks,
> Ryan
>
>
> EXAMPLE------------------
> Jess, the Java Expert System Shell
> Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
> Jess Version 5.2 5/3/2001
>
> Jess> (assert (numletter 1234560D))
> <Fact-0>
> Jess> (facts)
> f-0 (numletter 1234560.0)
> For a total of 1 facts.
> Jess> (assert (numletter "1234560D"))
> <Fact-1>
> Jess> (facts)
> f-0 (numletter 1234560.0)
> f-1 (numletter "1234560D")
> For a total of 2 facts.
> Jess> (assert (numletter 1234567F))
> <Fact-2>
> Jess> (facts)
> f-0 (numletter 1234560.0)
> f-1 (numletter "1234560D")
> f-2 (numletter 1234567.0)
> For a total of 3 facts.
> Jess> (assert (numletter 1234567Q))
> <Fact-3>
> Jess> (facts)
> f-0 (numletter 1234560.0)
> f-1 (numletter "1234560D")
> f-2 (numletter 1234567.0)
> f-3 (numletter 1234567Q)
> For a total of 4 facts.
>
>
>
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [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 (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------