12.07.2015 Views

Programmer's Guide & Language Reference - Dyalog Limited

Programmer's Guide & Language Reference - Dyalog Limited

Programmer's Guide & Language Reference - Dyalog Limited

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1: Introduction 28⎕FR has workspace scope, and may be localised. If so, like most other system variables,it inherits its initial value from the global environment.However: Although ⎕FR can vary, the system is not designed to allow “seamless”modification during the running of an application and the dynamic alteration of ⎕FRis not recommended. Strange effects may occur. For example, the type of a constantcontained in a line of code (in a function or class), will depend on the value of ⎕FRwhen the function is fixed. Similarly, a constant typed into a line in the Session isevaluated using the value of ⎕FR that pertained before the line is executed. Thus, itwould be possible for the first line of code above to return 0, if it is in the body of afunction. If the function was edited and while suspended and execution is resumed,the result would become 1. Also note:1⎕FR←1287x←1÷3⎕FR←645x=1÷3The decimal number has 17 more 3s. Using the tolerance which applies to binaryfloats (type 645), the numbers are equal. However, the “reverse” experiment yields 0,as tolerance is much narrower in the 128-bit universe:0⎕FR←645x←1÷3⎕FR←1287x=1÷3Since ⎕FR can vary, it will be possible for a single workspace to contain floatingpointvalues of both types (existing variables are not converted when ⎕FR ischanged). For example, an array that has just been brought into the workspace fromexternal storage may have a different type from ⎕FR in the current namespace. Conversion(if necessary) will only take place when a new floating-point array is generatedas the result of “a calculation”. The result of a computation returning afloating-point result will not depend on the type of the arrays involved in the expression:⎕FR at the time when a computation is performed decides the result type, alone.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!