restricted_int implementation

Now uses a custom type for integer values, so that similar errors are
displayed for both floats and ints.