Interpreter accepts integers exceeding max_integer
Dave Sworin <[email protected]> Tue, 28 Oct 2008 02:00:42 -0700 (PDT)
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
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