home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 420.lha / kFloat_v1.0 / ReadMe < prev    next >
Text File  |  1990-09-30  |  4KB  |  113 lines

  1.  
  2. kFloat v1.0 - Improves execution time of some floating point
  3.               words of ju:float.ffp
  4. Jerry Kallaus  05/08/89
  5.                   
  6. JForth and assembly code which dramatically improves execution
  7. time of FFP floating point arithmetic of ju:float.ffp in
  8. JForth v2.0.
  9.  
  10. When this code is "included", it "includes" ju:float.ffp if
  11. necessary and redefines several words.  Functionally, everything
  12. should basically work as before.
  13.  
  14. The floating point package contained in ju:float.ffp provides
  15. conditional operator words which check the condition code from
  16. the last floating point operation and leave a flag on the stack.
  17. These words are FLT FLE FEQ FNE FGE FGT FVC FVS.
  18.  
  19. Unfortunately, while the code for these words is fast, providing
  20. them requires that the condition code resulting from every
  21. floating point operation must be retrieved and saved in case one
  22. of these words is used in following code.  This can be eliminated
  23. in areas of the users code by setting the compile time flag
  24. FP-STATUS? OFF.  When this flag is off, the condition checking
  25. words listed above may NOT be used.  Note that
  26. FP-STATUS? ON must be used prior to the use of any floating point
  27. code for which the condition will be checked by one of
  28. the words listed above.  Note also that there are several other
  29. floating point relational and condition checking words for
  30. which are NOT affected by any of this.
  31.  
  32. In any case, a faster library interface is provided for the
  33. four arithmetic operators f+,f-,f* and f/.  Faster code
  34. is also provided for the following words:
  35. FLOAT, INT, FIX, F2*, F2/, DEG>RAD, and RAD>DEG.
  36. The constant for RAD/DEG is added.
  37. None of the transcendental words have been changed.
  38.  
  39.  
  40. TIMING
  41.  
  42. Timing comparison of words of ju:float.ffp (old) and
  43. words redefined by kFloat (new) with status saving
  44. (w/ stat) and without status saving (wo/ stat).
  45. Times are approximate in microseconds.
  46.  
  47. op     old   new   new
  48.              w/    wo/
  49.              stat  stat
  50.  
  51. f+     116    78    56
  52. f-     116    78    58
  53. f*     150   116    90
  54. f/     186   148   120
  55. float  134    42    42
  56. int    122    24    22
  57. fix    150    38    38
  58. f2*     54    32     4
  59. f2/     54    32     4
  60.  
  61.  
  62.  
  63. BUGS
  64.  
  65. None known, but would appreciate knowing of any that are found.
  66.  
  67. This package corrects the following  problems in both
  68. the Amiga 1.3 mathtrans.library and JFORTH 2.0 ju:float.ffp.
  69.  
  70.  
  71. Amiga FFP floating point math library.
  72.  
  73. _MathBase SPFix
  74.  
  75. Any argument with a low order byte of zero results in the
  76. input returned as the result even though bits are set in the
  77. high order three bytes, a large integer.
  78. Should return zero since a ffp exponent of zero represents
  79. an exponent of 2**(-64).
  80.  
  81.  
  82.  
  83. JForth ju:float.ffp floating point math utilities.
  84.  
  85. ju:float.ffp F2*
  86.  
  87. Given an argument of zero, F2* will increment the exponent part
  88. to a one and return $ 00000001 as a result; an attempt to print
  89. with F. will give the error message
  90. "...warning fp too large to fix".
  91. F2* should return zero for an argument of zero.
  92.  
  93.  
  94. ju:float.ffp FLOAT
  95.  
  96. Has a problem with large negative integer arguments in the range
  97. $ ffdf,ffff through $ 8000,0001.  For example
  98. $ 8000,0001 results in $ 8020,00E0, should be $ 8000,00E0
  99. $ FFDF,FF00 results in $ 8000,02D7, should be $ 8000,04D6
  100. The comments in the code for FLOAT suggest that it needs to
  101. do something special for arguments greater than 2**21 because
  102. the library FLOAT cannot handle them.  Actually, the library
  103. code seems to work fine, but gets messed up by this special code???
  104. Maybe the library was fixed from an earlier version.
  105.  
  106.  
  107. ju:float.ffp INT, and thus also FIX
  108.  
  109. When an overflow occurs, returns a value of zero!?
  110. The library returns maximum positive or negative integer;
  111. this seems more appropriate to me.
  112.  
  113.