Undefined values: Difference between revisions
Content added Content deleted
(Added BBC BASIC) |
|||
Line 568: | Line 568: | ||
=={{header|Mathematica}}== |
=={{header|Mathematica}}== |
||
Mathematica is a symbolic mathematical software. Variables without given values are treated as symbols. |
|||
⚫ | |||
<lang Mathematica>a |
|||
⚫ | |||
-> a |
|||
a + a |
|||
-> 2 a |
|||
ValueQ[a] |
|||
-> False |
|||
a = 5 |
|||
-> 5 |
|||
ValueQ[a] |
|||
-> True</lang> |
|||
Mathematica also has a build-in symbol "Undefined", representing a quantity with no defined value. |
|||
⚫ | |||
->Undefined</lang> |
|||
Mathematical expressions containing Undefined evaluate to Undefined: |
Mathematical expressions containing Undefined evaluate to Undefined: |
||
<lang Mathematica>Sin[Undefined] |
|||
Sin[a] |
|||
-> Undefined </lang> |
-> Undefined </lang> |
||
Of course you can assign Undefined to be the value of a variable. Here "Undefined" is itself a value. |
|||
<lang Mathematica>a = Undefined |
|||
⚫ | |||
a |
|||
-> Undefined |
|||
ValueQ[a] |
|||
-> True</lang> |
|||
=={{header|MATLAB}} / {{header|Octave}}== |
=={{header|MATLAB}} / {{header|Octave}}== |