"SemanticInteger" (interpreter type)

Integer number in a standard format or in natural language.

DetailsDetails

Allowed FormsAllowed Forms

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

Restriction SpecificationsRestriction 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

ExamplesExamplesopen allclose all

Basic Examples  (2)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]=