"ComputedQuantity" (Interpreter Type)
Quantity derived by computation.
Details
- "ComputedQuantity" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "ComputedQuantity" requires connectivity to the Wolfram Cloud.
Allowed Forms
- Any natural-language quantity supported by "Quantity", or a computation yielding one.
Restriction Specifications
-
Restricted["ComputedQuantity",{{choices1,…}}] one among choices Restricted["ComputedQuantity",unit] convert to unit Restricted["ComputedQuantity",quantityvariable] restrict to units compatible with the physical quantity of quantityvariable Restricted["ComputedQuantity",unit,max] a quantity below Quantity[max,unit] Restricted["ComputedQuantity",unit,{min,max}] a quantity between Quantity[min,unit] and Quantity[max,unit] Restricted["ComputedQuantity",unit,{min,max,s}] a quantity between Quantity[min,unit] and Quantity[max,unit] with step s Restricted["ComputedQuantity",quantityvariable,max] a quantity below Quantity[max,unit], with unit the canonical unit of quantityvariable - The bounds min and max and step s can also be expressed as quantities.
Interpretation
- "ComputedQuantity" yields a Quantity.
Examples
Basic Examples (5)Summary of the most common use cases
Interpret quantities involving computations:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-rae2nv
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-es8jqv
Out[2]=2

Computations with data are allowed:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-o1tusi
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-02ultx
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-ih6d66
Out[3]=3

In[4]:=4

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-h871i
Out[4]=4

Restrict and convert to a unit:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-qd9f7x
Out[1]=1

Restrict to a given physical quantity:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-jr8opj
Out[1]=1

Accept unitless inputs in the presence of an appropriate restriction:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-4ai23v
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-qzpjj7
Out[2]=2

Attach the unit to the interpreted number:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-zbl9lm
Out[1]=1

Restrict with a bound and convert to a given unit:
In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-slxp8e
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0l9u16wrcao9c0o7yv2p4bd2-t1n6r1
Out[1]=1
