"SemanticNumber" (interpreter type)

Number in a standard format or in natural language.

DetailsDetails

Allowed FormsAllowed Forms

  • 1234, -1234, etc.integers
    12.34real numbers
    12.45e45, 1.2E-5numbers in scientific notation
    12,345.67numbers with separators
    two, a fifthnumbers in natural language
    3/5, -1/2rational numbers

Restriction SpecificationsRestriction Specifications

  • Restricted["SemanticNumber",{{choices1,}}]one among choices
    Restricted["SemanticNumber",max]a number below max
    Restricted["SemanticNumber",{min,max}]a number between min and max
    Restricted["SemanticNumber",{min,max,s}]a number between min and max, with step s

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Interpret numbers:

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

Interpret numbers in natural language:

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]=