home *** CD-ROM | disk | FTP | other *** search
/ Power DOS 1995 July / Power_DOS_CD-ROM_Walnut_Creek_July_1995.iso / program / oberon_3 / changes.txt < prev    next >
Text File  |  1993-06-30  |  5KB  |  156 lines

  1. OBERON FOR MS-DOS
  2.  
  3. System 3 
  4.  
  5. This file contains all the changes made for the current release.
  6.  
  7. 14. 6. 93
  8.  Version 1.2
  9.  Improved real arithmetic (see below)
  10.  Start of this file.
  11.  
  12.  
  13. AN IMPROVED IMPLEMENTATION OF THE FLOATING-POINT CONVERSION
  14.  
  15. The floating-point handling has been improved in the Oberon implementation 
  16. that is shipped with this note. The original version of Oberon, as published 
  17. in [1] suffer from the following deficiencies:
  18.  
  19. 1) The floating-point numbers from a source file which are scanned by the 
  20.    compiler and floating-point numbers read in from a text file by Texts.Scan 
  21.    are not necessarily identical. The bit pattern differs in the least 
  22.    significant part. Furthermore, the decimal-to-binary conversion is 
  23.    inaccurate.
  24.  
  25. 2) The trap handler prints fewer decimal digits of REALs and LONGREALs than 
  26.    significant.
  27.  
  28. 3) The two least significant digits (7-8 for REALs and 15-16 for LONGREALs) 
  29.    are often wrong.
  30.  
  31. 4) The procedure Texts.WriteRealFix has the same deficiencies as 
  32.    Texts.WriteReal; moreover it traps for some parameters.
  33.  
  34. 5) For floating-point numbers with certain binary exponents (listed 
  35.    subsequently), the decimal exponent printed is wrong by one decimal unit!
  36.    For example: all floating-point numbers x with 2^-103 <= x < 2^-102 are 
  37.    printed with a wrong exponent.
  38.  
  39.    REALs:
  40.            wrong          correct
  41.    2^-103  9.8607620E-31   9.8607613E-32
  42.    2^-113  9.6296500E-34   9.6296497E-35
  43.    2^-123  9.4039550E-37   9.4039548E-38
  44.  
  45.    LONGREALs: (totally 132 cases)
  46.            wrong                  correct
  47.    2^-103  9.860761315262652D-031  9.860761315262648D-032
  48.    2^-113  9.629649721936183D-034  9.629649721936179D-035
  49.    2^-123  9.403954806578305D-037  9.403954806578299D-038
  50.    ...
  51.    2^-1017  7.120236347223050D-306 7.120236347223044D-307
  52.    2^-1020  8.900295434028810D-307 8.900295434028805D-308
  53.  
  54.  
  55. All errors mentioned above are avoided by the new implementation. Since 
  56. IEEE error codes and denormalized numbers are not always supported, all 
  57. error codes are printed as "NaN" (Not-a-Number) and denormalized numbers 
  58. are flushed to zero. Besides, the functionality of the WriteRealFix has 
  59. been redesigned, and WriteLongRealFix has been added:
  60.  
  61. Description:
  62.  
  63.  PROCEDURE WriteLongRealFix* (VAR W: Writer; x: LONGREAL; n, f, D: LONGINT);
  64.  
  65.  The parameters are:
  66.  
  67.  W       a Texts.Writer
  68.  x       the LONGREAL number to be printed
  69.  n       the overall field length available for the output
  70.  f       the number of fraction digits following the decimal point
  71.  D       the fixed exponent (printed only when D # 0)
  72.  
  73.  
  74. Example:  The following program excerpt
  75.  
  76.  e:= -310;
  77.  WHILE e <= -277 DO
  78.   Texts.WriteInt(W, e, 2);
  79.   Texts.WriteLongRealFix(W, -1.234567898765432D-300,30,5,e);
  80.   Texts.WriteLn(W);
  81.   INC(e)
  82.  END
  83.  
  84.     delivers the following output:
  85.  
  86.     -310                           NaN
  87.     -309                           NaN
  88.     -308 -***********************D-308
  89.     -307 -***********************D-307
  90.     -306 -***********************D-306
  91.     -305 -***********************D-305
  92.     -304 -***********************D-304
  93.     -303 -***********************D-303
  94.     -302 -***********************D-302
  95.     -301 -***********************D-301
  96.     -300 -1.234567898765431000000D-300
  97.     -299 -0.123456789876543100000D-299
  98.     -298 -0.012345678987654310000D-298
  99.     -297 -0.001234567898765431000D-297
  100.     -296 -0.000123456789876543100D-296
  101.     -295 -0.000012345678987654310D-295
  102.     -294 -0.000001234567898765432D-294
  103.     -293 -0.000000123456789876543D-293
  104.     -292 -0.000000012345678987654D-292
  105.     -291 -0.000000001234567898765D-291
  106.     -290 -0.000000000123456789877D-290
  107.     -289 -0.000000000012345678988D-289
  108.     -288 -0.000000000001234567899D-288
  109.     -287 -0.000000000000123456790D-287
  110.     -286 -0.000000000000012345679D-286
  111.     -285 -0.000000000000001234568D-285
  112.     -284 -0.000000000000000123457D-284
  113.     -283 -0.000000000000000012346D-283
  114.     -282 -0.000000000000000001235D-282
  115.     -281 -0.000000000000000000123D-281
  116.     -280 -0.000000000000000000012D-280
  117.     -279 -0.000000000000000000001D-279
  118.     -278 -0.000000000000000000000D-278
  119.     -277 -0.000000000000000000000D-277
  120.  
  121. The least significant non zero digit (in this example: 1 resp. 2 when 
  122. D >= -300) has an error of at most 2 decimal units caused by the rounding 
  123. error in the least significant bit of 10^D and the subsequent 
  124. multiplication with the mantissa.
  125.  
  126. All the computations in the floating-point units are done correctly. The 
  127. testing of the modules Math and MathL is in progress.
  128.  
  129. For further information or remarks please contact either the corresponding
  130. implementor at the 
  131.  
  132.     Institut für Computersysteme ETH, 8092 Zürich, Switzerland,
  133.     Telephone (1)254 7311, Facsimile (1)262 3973
  134.  
  135. or the author of this note.
  136.  
  137.  
  138. Reference
  139.  
  140. [1] N. Wirth and J. Gutknecht: Project Oberon. The Design of an Operating 
  141.     System and Compiler. Addison Wesley, 1992, ISBN 0-201-54428-8.
  142.     Program listings with explanations for the whole Oberon system, 
  143.     including the compiler for NS32000.
  144.  
  145.  
  146. Bernd Moesli
  147. moesli@sam.math.ethz.ch
  148. Seminar for Applied Mathematics
  149. Swiss Federal Institute of Technology Zurich
  150. ETH-Zentrum
  151. Fliederstr. 23
  152. CH-8092 Zuerich, Switzerland
  153.  
  154.  
  155. BM      1993.3.15       Copyright 1993
  156.