bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interpreter accepts integers exceeding max_integer


From: Dave Sworin
Subject: Interpreter accepts integers exceeding max_integer
Date: Tue, 28 Oct 2008 02:00:42 -0700 (PDT)

When a predicate takes an integer argument, it is not useful to check the range 
of
the argument using min_integer and max_integer because the interpreter passes 
the numbers to the predicate already wrapped.  For example:

my_pred(222222222222). will be received as -1, which is within the range of 
min_integer
and max_integer. (I tested this with Fedora Core 4 which has a max_integer of 
about
256 million.)

Should the interpreter reject this input as a syntax error?  Or convert it to a 
float or something?

Dave



      




reply via email to

[Prev in Thread] Current Thread [Next in Thread]