"SemanticInteger" (Interpreter Type)

Integer number in a standard format or in natural language.

Details

Allowed Forms

  • 1234positive integers
    -1234negative integers
    12,456integers with separators
    twointegers in natural language

Restriction Specifications

  • Restricted["SemanticInteger",{{choices1,}}]one among choices
    Restricted["SemanticInteger",max]an integer below max
    Restricted["SemanticInteger",{min,max}]an integer between min and max
    Restricted["SemanticInteger",{min,max,s}]an integer between min and max, with step s

Interpretation

Examples

Basic Examples  (2)

Interpret integer numbers:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Restrict in a range:

In[1]:=
Click for copyable input
Out[1]=

Restrict to the first five prime numbers:

In[1]:=
Click for copyable input
Out[1]=

Restrict to odd numbers below 100:

In[1]:=
Click for copyable input
Out[1]=

Related Interpreters

See Also

Interpreter  SemanticImport  Restricted  Failure  Integer