Rational number syntax error operator expected, possible bug

I’m using: SWI-Prolog version 7.6.4

I want the code to: Operate on rational numbers using the documented MrN syntax. I should have rational support because current_prolog_flag(bounded, false). There seems to be a workaround using M rdiv N but that’s annoying to type every time.

But what I’m getting is: syntax errors

My code looks like this:

?- X is 1r2.
ERROR: Syntax error: Operator expected
ERROR: X is 
ERROR: ** here **
ERROR: 1r2 . 

Rational number support using the NrD syntax requires a much more recent version. I think 8.4.x or 8.5.x.

1 Like