Changes

Jump to navigation Jump to search

math.setEvalSettings

2,003 bytes added, 16:09, 30 May 2013
Created page with "'''math.setEvalSettings''' is a math library extension used to override one or more of the current document settings for all subsequent math evaluations performed by [[math.eval]..."
'''math.setEvalSettings''' is a math library extension used to override one or more of the current document settings for all subsequent math evaluations performed by [[math.eval]] and [[math.evalStr]].
It does not change the document context settings. <br />


The function '''math.setEvalSettings''' may be called at any point in the script app. The modified document settings are used by [[math.eval]] for all subsequent calls within the script app (unless modified by a subsequent call to ''setEvalSettings'' ).


'''Note''' : All results from the TI-Nspire math server are returned as full-precision expressions. If users want to limit the display digits, they must call [[math.getEvalSettings]]() and apply the appropriate precision before displaying the value returned by the TI-Nspire math server.


{{Since|3.2}}
== Syntax ==

math.'''setEvalSettings'''(settingsTable)

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u><center>settingsTable</center></u> || table || Table of tables. Each inner table consists of the name of the document setting to override and the name of the value to use instead.
The key-values are either text strings or the number they're linked to.
|-
|}


== Example ==


<source lang="lua">
settings = {
{'Unit System','Eng/US'},
{'Calculation Mode','Approximate'},
{'Real or Complex Format','Polar'},
{'Exponential Format','Engineering'}
}
math.setEvalSettings(settings)
</source>

For user convenience, setEvalSettings also accepts the ordinal number of the setting to override and the ordinal number of the value to use instead. The ordinal numbers to use correspond to the order of the settings and their values found at File > Settings > Document Settings.

<source lang="lua">

settings = {
{2,3},
{4,3},
{6,3},
{8,2}
}
math.setEvalSettings(settings)
</source>

In fact, setEvalSettings accepts any combination of names (strings) and ordinal numbers.



== See also ==

[[math.eval]]

[[Category:Extended_Standard_Library]]

Navigation menu