home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / g / lib / bug / 609 < prev    next >
Encoding:
Text File  |  1992-11-22  |  6.7 KB  |  175 lines

  1. Newsgroups: gnu.g++.lib.bug
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!uropax.contrib.de!thomax
  3. From: thomax@uropax.contrib.de (Thomas Kaulmann)
  4. Subject: problems with g++-2.3.1, libg++-2.2, vax-ultrix
  5. Message-ID: <1992Nov22.123804.19791@uropax.contrib.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Contributed Software GbR
  8. Distribution: gnu
  9. Date: Sun, 22 Nov 1992 12:38:04 GMT
  10. Approved: bug-lib-g++@prep.ai.mit.edu
  11. Lines: 162
  12.  
  13. hello,
  14.  
  15. i've a problem in the libg++-2.2 test suite (rationals test) -
  16. the problem occurs only on vax-ultrix. i've no probs with the stuff
  17. on sunos, dec-ultix or ISC3.0..
  18. the rest of the test works well, here are the results of the
  19. tRational.cc test:
  20.  
  21. EXCEPT:
  22. ==========================================================================
  23. one = 1
  24. third = 1/3
  25. half = 1/2
  26. third + half = 5/6
  27. third - half = -1/6
  28. third * half = 1/6
  29. third / half = 2/3
  30. onePointTwo = 5404319552844595/4503599627370496
  31. double(onePointTwo) = 1.2
  32. a = 1
  33. a += half = 3/2
  34. a -= half = 1
  35. a *= half = 1/2
  36. a /= half = 1
  37. approxpi = 355/113
  38. double(approxpi) = 3.14159
  39. rpi = Rational(PI) = 884279719003555/281474976710656
  40. double(rpi) = 3.14159
  41. approxpi + rpi = 199847224979684595/31806672368304128
  42. approxpi - rpi = 8484881165/31806672368304128
  43. approxpi * rpi = 313919300246262025/31806672368304128
  44. approxpi / rpi = 19984723346456576/19984721649480343
  45. -approxpi = -355/113
  46. abs(negapproxpi) = 355/113
  47.  
  48. enter a Rational in form a/b or a: number = 61727839/49382716
  49. approximating e as pow(1+1/n),n) for n =10
  50. double(approxe) = 2.59374
  51. log(approxe) = 0.953102
  52. approxe = 25937424601/10000000000
  53. approximating e as pow(1+1/n),n) for n =100
  54. double(approxe) = 2.70481
  55. log(approxe) = 0.995033
  56. approxe = 2704813829421526093267194710807530833677938382781002776890201049117101
  57. 51430673927943945601434674459097335651375483564268312519281766832427980496322329
  58. 650055217977882315938008175933291885667484249510001/1000000000000000000000000000
  59. 00000000000000000000000000000000000000000000000000000000000000000000000000000000
  60. 00000000000000000000000000000000000000000000000000000000000000000000000000000000
  61. 0000000000000
  62. approximating e as pow(1+1/n),n) for n =1000
  63. double(approxe) = 2.71692
  64. log(approxe) = 0.9995
  65. approxe = 2716923932235892457383088121947577188964315018836572803722354774868894
  66. 94552376815899788569729866142905342103401540625692485946118761765388945775359308
  67. 33863995720635385004326501761444880461710448441218054796076480866070187420777983
  68. 75087855857012278053105042704758822511824867218226931719410407150364389665913091
  69. 82257681907228183573536578620217616722868619815846072464105240750630582621115696
  70. 47230644412959694982219192514792117009419351147555319726773601575614851442377868
  71. 16579422141378066423317811515462669946309306263409027388915931082226854264858661
  72. 42087827998353442412867246120635684746382136463050435966517157363539734603727475
  73. 24103681748774339412345431535111004716514728691160685284789769166005853834971801
  74. 72395573924789047989563714318957536493108041591460911612078698461739084741934442
  75. 44870141657548326389152909515801323311564853415408600931219048916854602439883424
  76. 38471351024116619960201295579214446663436410391379068075913427424642009919337227
  77. 91531063202677650581946360422!
  78. 027765645970182463780273161113009
  79.  
  80. End of test
  81.  
  82.  
  83. OUTPUT:
  84. ==========================================================================
  85. one = 1
  86. third = 1/3
  87. half = 1/2
  88. third + half = 5/6
  89. third - half = -1/6
  90. third * half = 1/6
  91. third / half = 2/3
  92. onePointTwo = 21617278211378381/18014398509481984
  93. double(onePointTwo) = 1.2
  94. a = 1
  95. a += half = 3/2
  96. a -= half = 1
  97. a *= half = 1/2
  98. a /= half = 1
  99. approxpi = 355/113
  100. double(approxpi) = 3.14159
  101. rpi = Rational(PI) = 28296951008113761/9007199254740992
  102. double(rpi) = 3.14159
  103. approxpi + rpi = 6395111199349907153/1017813515785732096
  104. approxpi - rpi = 271516197167/1017813515785732096
  105. approxpi * rpi = 10045417607880385155/1017813515785732096
  106. approxpi / rpi = 3197555735433052160/3197555463916854993
  107. -approxpi = -355/113
  108. abs(negapproxpi) = 355/113
  109.  
  110. enter a Rational in form a/b or a: number = 61727839/49382716
  111. approximating e as pow(1+1/n),n) for n =10
  112. double(approxe) = 2.59374
  113. log(approxe) = 0.953102
  114. approxe = 25937424601/10000000000
  115. approximating e as pow(1+1/n),n) for n =100
  116. double(approxe) = 2.70481
  117. log(approxe) = 0.995033
  118. approxe = 2704813829421526093267194710807530833677938382781002776890201049117101
  119. 51430673927943945601434674459097335651375483564268312519281766832427980496322329
  120. 650055217977882315938008175933291885667484249510001/1000000000000000000000000000
  121. 00000000000000000000000000000000000000000000000000000000000000000000000000000000
  122. 00000000000000000000000000000000000000000000000000000000000000000000000000000000
  123. 0000000000000
  124. approximating e as pow(1+1/n),n) for n =1000
  125. double(approxe) = 2.71692
  126. log(approxe) = 0.9995
  127. approxe = 2716923932235892457383088121947577188964315018836572803722354774868894
  128. 94552376815899788569729866142905342103401540625692485946118761765388945775359308
  129. 33863995720635385004326501761444880461710448441218054796076480866070187420777983
  130. 75087855857012278053105042704758822511824867218226931719410407150364389665913091
  131. 82257681907228183573536578620217616722868619815846072464105240750630582621115696
  132. 47230644412959694982219192514792117009419351147555319726773601575614851442377868
  133. 16579422141378066423317811515462669946309306263409027388915931082226854264858661
  134. 42087827998353442412867246120635684746382136463050435966517157363539734603727475
  135. 24103681748774339412345431535111004716514728691160685284789769166005853834971801
  136. 72395573924789047989563714318957536493108041591460911612078698461739084741934442
  137. 44870141657548326389152909515801323311564853415408600931219048916854602439883424
  138. 38471351024116619960201295579214446663436410391379068075913427424642009919337227
  139. 91531063202677650581946360422!
  140. 027765645970182463780273161113009
  141.  
  142. End of test
  143.  
  144. DIFFERENCE
  145. ==========================================================================
  146. 8c8
  147. < onePointTwo = 5404319552844595/4503599627370496
  148. ---
  149. > onePointTwo = 21617278211378381/18014398509481984
  150. 17c17
  151. < rpi = Rational(PI) = 884279719003555/281474976710656
  152. ---
  153. > rpi = Rational(PI) = 28296951008113761/9007199254740992
  154. 19,22c19,22
  155. < approxpi + rpi = 199847224979684595/31806672368304128
  156. < approxpi - rpi = 8484881165/31806672368304128
  157. < approxpi * rpi = 313919300246262025/31806672368304128
  158. < approxpi / rpi = 19984723346456576/19984721649480343
  159. ---
  160. > approxpi + rpi = 6395111199349907153/1017813515785732096
  161. > approxpi - rpi = 271516197167/1017813515785732096
  162. > approxpi * rpi = 10045417607880385155/1017813515785732096
  163. > approxpi / rpi = 3197555735433052160/3197555463916854993
  164.  
  165.  
  166. what is the error and how can i solve it??
  167.  
  168.  
  169. thomax
  170. -- 
  171. Contributed Software, Thomas Kaulmann, Graefestr. 42, 1000 Berlin 61
  172. G N U  &  N E T W O R K S  &  U N I X  Tel. : +49 30 694 69 07
  173. Mail: thomax@contrib.de                Modem: +49 30 694 (6182|6749|6809)
  174.  
  175.