System Variable CT: Difference between revisions

From NARS2000
Jump to navigationJump to search
Set up ⎕CT - Comparison Tolerance
m minor terminology
 
Line 3: Line 3:
| Value used by several primitive functions to determine whether two
| Value used by several primitive functions to determine whether two
numbers should be considered equal; default for a CLEAR NARS workspace is 3E¯15. }}
numbers should be considered equal; default for a CLEAR NARS workspace is 3E¯15. }}
{{BoxEnd|⎕CT←'<i>VALUE</i>'}}
{{BoxEnd|⎕CT←<i>RealNumber</i>}}


Due to computer storage formats, real numbers are normally expressed as n-bits of information<br>
Due to computer storage formats, real numbers(e.g. 1E¯64) are normally expressed as n-bits of information<br>
and ''not necessarily an exact number''.  NARS allows ⎕CT to vary between no larger than 1E¯10 and no smaller than 0.
and ''not necessarily an exact number''.  NARS allows ⎕CT to vary between no larger than 1E¯10 and no smaller than 0.<br>
The IEEE [minimum] standard for floating point real numbers is 64-bits(IEEE-754).


Examples:
Examples:
Line 32: Line 33:
3E¯15
3E¯15
</pre>
</pre>
It is useful to think of ⎕CT as an engineering tolerance +/- for computer science engineers in comparing numbers in APL - sometimes comparing results from '''different computer programs''' or comparing results from '''different methodologies or a standard'''.  In Mechanical Engineering, tolerance is defined as the permissible deviation from a specified value of some dimension, often expressed as a percent, e.g. 0.0000001%.<br>
It is useful to think of ⎕CT as an engineering tolerance +/- for computer science engineers in comparing numbers in APL - sometimes comparing results from '''different computer programs''' or comparing results from '''different methodologies or a standard'''.  In Mechanical Engineering, tolerance is defined as the permissible deviation from a specified value of some dimension, often expressed as a percent, e.g. 0.01% and in Nanotechnology, for example, one nanometer is 1E-9 of a meter. <br><br>
'''See Also: [[System_Variable_FPC|⎕FPC - Floating Point Control]]'''<br><br>
{{System Variables}}
{{System Variables}}
{{Article footer}}
{{Article footer}}
{{stub}}
{{stub}}

Latest revision as of 01:06, 12 February 2015

⎕CT - Comparison Tolerance

⎕CT Value used by several primitive functions to determine whether two numbers should be considered equal; default for a CLEAR NARS workspace is 3E¯15.
⎕CT←RealNumber

Due to computer storage formats, real numbers(e.g. 1E¯64) are normally expressed as n-bits of information
and not necessarily an exact number. NARS allows ⎕CT to vary between no larger than 1E¯10 and no smaller than 0.
The IEEE [minimum] standard for floating point real numbers is 64-bits(IEEE-754).

Examples:


      ⎕CT         ⍝ View ⎕CT for a CLEAR NARS workspace.
3E¯15             ⍝ Default value.
      ⎕CT←45      ⍝ Attempt to change Comparison Tolerance to [+/-] 45 (an exaggerated engineering +/- tolerance.
      ⎕CT         ⍝ View ⎕CT after attempting to set its value at 45.
1E¯10             ⍝ This is the largest ⎕CT number NARS will allow = 1E¯10 (and NOT 45 as was attempted just above).

      4.0000000000005=4.0000000000008   ⍝ Comparison attempted.  Are these two different numbers equal? (No, but...).
1                 ⍝ NARS/APL's Interpreter says YES(1), they ARE EQUAL - because the Comparison Tolerance is set high/large.
      ⎕CT←1E¯64   ⍝ Set NARS comparison tolerance to a much smaller number (for greater precision comparisons).
      ⎕CT         ⍝ View ⎕CT
1E¯64
      4.0000000000005=4.0000000000008   ⍝ Are these two different [but the same as above] numbers NOW equal? (No).
0            ⍝ NARS/APL's Interpreter says NO(0), they are NOT EQUAL - because the Comparison Tolerance is set below the threshold.

      ⎕CT←1E¯10000
      ⎕CT
0
      ⎕CT←3E¯15   ⍝ Reset ⎕CT to its default value.
      ⎕CT
3E¯15

It is useful to think of ⎕CT as an engineering tolerance +/- for computer science engineers in comparing numbers in APL - sometimes comparing results from different computer programs or comparing results from different methodologies or a standard. In Mechanical Engineering, tolerance is defined as the permissible deviation from a specified value of some dimension, often expressed as a percent, e.g. 0.01% and in Nanotechnology, for example, one nanometer is 1E-9 of a meter.

See Also: ⎕FPC - Floating Point Control

System Variables (A value may be assigned to these except for ⎕DM)
⎕ALX ⎕CT ⎕DM ⎕DT ⎕ELX ⎕FC ⎕FEATURE ⎕FPC ⎕IC ⎕IO
⎕LR ⎕LX ⎕PP ⎕PR ⎕PW ⎕RL ⎕SA ⎕WSID
Niladic System Functions (a value cannot be assigned to these)
⎕A ⎕AV ⎕EM ⎕ET ⎕LC ⎕NNAMES ⎕NNUMS ⎕SI ⎕SYSID ⎕SYSVER
⎕T ⎕TC ⎕TCBEL ⎕TCBS ⎕TCESC ⎕TCFF ⎕TCHT ⎕TCLF ⎕TCNL ⎕TCNUL
⎕TS ⎕WA
Monadic or dyadic system functions (a value cannot be assigned to these)
⎕AT ⎕CR ⎕DC ⎕DFT ⎕DL ⎕DR ⎕EA ⎕EC ⎕ERROR ⎕ES
⎕EX ⎕FMT ⎕FX ⎕MF ⎕NAPPEND ⎕NC ⎕NCREATE ⎕NERASE ⎕NINFO ⎕NL
⎕NLOCK ⎕NREAD ⎕NRENAME ⎕NREPLACE ⎕NRESIZE ⎕NSIZE ⎕NTIE ⎕NUNTIE ⎕STOP ⎕TF
⎕TRACE ⎕UCS ⎕VR
Note that quad functions and variables (except for the ⎕A family of functions) are case insensitive


See Also
System Commands System Variables and Functions Operators


Keyboard
A+S ⍪ ≡ ≢ ⍒ ⍋ ⌽ ⍉ ⊖ ⍟ ⍱ ⍲ ⍠ ⌹
Alt ⋄ ¨ ¯ < ≤ ∅ ≥ > ≠ ∨ ∧ × ÷
Sh ~ ! @ # $ % ^ & * ( ) _ +
Key ` 1 2 3 4 5 6 7 8 9 0 - =
A+S ⍷ √ ⍨ ⍸ ⍥ ⍣ ⍞ ⍬ ⊣
Alt ? ⍵ ∊ ⍴ § ↑ ↓ ⍳ ○ π ← → ⊢
Sh Q W E R T Y U I O P { } |
Key q w e r t y u i o p [ ] \
A+S ∫ ∂ ⌻ ⍢ ⍙ ⍤ ⍫ ⌷
Alt ⍺ ⌈ ⌊ ∞ ∇ ∆ ∘ ‼ ⎕ ⍎ ⍕
Sh A S D F G H J K L : "
Key a s d f g h j k l ; '
A+S ⊆ ⊇ χ ⍡ ⍭ ⊙
Alt ⊂ ⊃ ∩ ∪ ⊥ ⊤ ⍦ ⍝ ⍀ ⌿
Sh Z X C V B N M < > ?
Key z x c v b n m , . /
{{#ifeq:{{{1}}}|4||title="match" style="border-width:thick; border-color:blue; background-color:yellow;"|≡ {{#ifeq:{{{1}}}|7||title="iota" style="border-width:thick; border-color:blue; background-color:yellow;" |⍳ {{#ifeq:{{{1}}}|9||title="slash" style="border-width:thick; border-color:blue; background-color:yellow;" |/ {{#ifeq:{{{1}}}|11||title="diamond" style="border-width:thick; border-color:blue; background-color:yellow;" |⋄ {{#switch: {{{1}}}
NARS 2000 Lang
Tool
Bar

{{#ifeq:{{{1}}}|1||title="assign" style="border-width:thick; border-color:blue; background-color:yellow;" |←

→ bgcolor=cyan title="assign" |← → }}

{{#ifeq:{{{1}}}|2||title="plus" style="border-width:thick; border-color:blue; background-color:yellow;" |+

- × ÷ * ⍟ ⌹ ○ ! ? √ bgcolor=cyan title="plus" |+ - × ÷ * ⍟ ⌹ ○ ! ? √ }}

{{#ifeq:{{{1}}}|3||title="mod" style="border-width:thick; border-color:blue; background-color:yellow;" ||

⌈ ⌊ ⊥ ⊤ ⊣ ⊢
⌈ ⌊ ⊥ ⊤ ⊣ ⊢
≢ < ≤ = ≥ > ≠ bgcolor=cyan title="match" |≡ ≢ < ≤ = ≥ > ≠ }}

{{#ifeq:{{{1}}}|5||title="down caret" style="border-width:thick; border-color:blue; background-color:yellow;" |∨

∧ ⍱ ⍲ bgcolor=cyan title="down caret" |∨ ∧ ⍱ ⍲ }}

{{#ifeq:{{{1}}}|6||title="take" style="border-width:thick; border-color:blue; background-color:yellow;" |↑

↓ ⊂ ⊃ ⌷ ⍋ ⍒
↓ ⊂ ⊃ ⌷ ⍋ ⍒
∊ ⍸ ⍷ ∪ ∩ ⊆ ⊇ ~ § π .. bgcolor=cyan title="iota" |⍳ ∊ ⍸ ⍷ ∪ ∩ ⊆ ⊇ ~ § π .. }}

{{#ifeq:{{{1}}}|8||title="comma" style="border-width:thick; border-color:blue; background-color:yellow;" |,

⍪ ⍴ ⌽ ⊖ ⍉
⍪ ⍴ ⌽ ⊖ ⍉
\ ⌿ ⍀ ⊙ ¨ ⍨ ⍤ ⍡ ⍥ ⍦ . ∘ ⍠ ‼ ⌻ ∂ ∫ bgcolor=cyan title="slash" |/ \ ⌿ ⍀ ⊙ ¨ ⍨ ⍤ ⍣ ⍡ ⍥ ⍦ . ∘ ⍠ ‼ ⌻ ∂ ∫ }}

{{#ifeq:{{{1}}}|10||title="quotequad" style="border-width:thick; border-color:blue; background-color:yellow;" |⍞

⎕ ⍎ ⍕
⎕ ⍎ ⍕
⍝ ∇ ∆ ⍙ _ ⍺ ⍵ bgcolor=cyan title="diamond" |⋄ ⍝ ∇ ∆ ⍙ _ ⍺ ⍵ }}

{{#ifeq:{{{1}}}|12||title="neg" style="border-width:thick; border-color:blue; background-color:yellow;" |¯

⍬ ∞ title="neg" |¯ ⍬ ∞ ∅
colspan=8 |Second Row i j k a b e g p r v x z colspan=8 |Second Row i j k a b e g p r v x z colspan=8 |Second Row i j k a b e g p r v x z colspan=6 |Second Row i j k i j k l g p r v x

}}

{{#ifeq:{{{1}}}|0| |[[Category:Mouse Group {{{1}}}|{{{2}}}]]}}




This NARS2000 article is a stub and needs further work.