7

What are the minimum/maximum integers in gprolog? Is there a way to reference these numbers without using a "magic number"?

false
  • 10,264
  • 13
  • 101
  • 209
user2309462
  • 126
  • 8

1 Answers1

8

I think these should work:

current_prolog_flag(bounded, X).
current_prolog_flag(min_integer, Y).
current_prolog_flag(max_integer, Z).

bounded tells you whether your implementation supports arbitrary large integers; if it's false, the min_integer / max_integer calls will fail.

Nick Barnes
  • 19,816
  • 3
  • 51
  • 63
  • 3
    Also note that, as the question tags hint, `bounded`, `min_integer`, and `max_integer` are ISO Prolog Core standard specified flags and you can use them with most Prolog systems. – Paulo Moura Nov 07 '13 at 18:02