home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gplibt02 / expected.out next >
Text File  |  1993-07-24  |  23KB  |  648 lines

  1. tfile
  2. Hello, world via cout
  3. enter a char:c = "a"
  4. enter three integers (short, int, long):first  = 123 via dec =      123
  5. second = 4567 via form = 4567 = 010727 via cout.form = 4567 = 0x11d7
  6. third  = 89012 via hex = 15bb4
  7. enter a float then a double:first  = 123.456
  8. second = -0.012
  9. enter 5 characters separated with spaces:first  = 1
  10. rest   =  2 3 4 5
  11.  
  12. Making streams sout and sin...contents of file:
  13. Thisfilehasonelinetestingoutputstreams.
  14. Making File tf ... first line of file:
  15. This is the first and only line of this file.
  16. next char = 10
  17. reopening tempfile, appending: Now there is a second line.
  18. First 10 chars via raw system read after reopen for input:
  19. This is th
  20. Contents after raw lseek to pos 5:
  21. is the first and only line of this file.
  22. Now there is a second line.
  23.  
  24. Making SFile rf...odd elements of file in reverse order:
  25. (i = 9 c = j d = 0.009)
  26. (i = 7 c = h d = 0.007)
  27. (i = 5 c = f d = 0.005)
  28. (i = 3 c = d d = 0.003)
  29. (i = 1 c = b d = 0.001)
  30.  
  31. Making PlotFile pf ...(You may delete or attempt to plot plot.out)
  32. creating ostrstream...
  33. with contents:
  34. This is a string-based stream.
  35. With two lines.
  36. using it to create istrstream...
  37. with contents:
  38. This is a string-based stream.
  39. With two lines.
  40.  
  41. Making filebuf streams fout and fin...contents of file:
  42. Thisfilehasonelinetestingoutputstreams.
  43.  
  44. Final names & states:
  45. cin:      (stdin)    0
  46. cout:     (stdout)    0
  47. cerr:     (stderr)    0
  48.  
  49. end of test.
  50. tobstack
  51. enter anything at all, end with an EOF(^D)
  52.  
  53. unique words:
  54. deleted
  55. redundant
  56. with
  57. this
  58. in
  59. words
  60. the
  61. list
  62. simply
  63. should
  64. program
  65. The
  66. Obstacks
  67. for
  68. file
  69. test
  70. simple
  71. a
  72. is
  73. This
  74.  
  75.  
  76. Obstack vars:
  77. alignment_mask = 3
  78. chunk_size = 4080
  79. size = 0
  80. room = 4056
  81.  
  82. end of test
  83. tstring
  84. an empty String:
  85. A string initialized to Hello:Hello
  86. A string initialized to previous string:Hello
  87. A string initialized to previous string.at(1, 2):el
  88. A string initialized to @:@
  89. A string initialized to dec(20):20
  90. n = 20 atoi(n) = 20 atof(n) = 20
  91. z = x + y = Helloworld
  92. x += y; x = Helloworld
  93. y.prepend(x); y = Helloworld
  94. cat(x, y, x, x); x = HelloworldHello
  95. cat(y, x, x, x); x = worldHelloHello
  96. z = x + s +  + y.at(w) + y.after(w) + . = Hello, world.
  97. ch = x[0] = H
  98. z = x.at(2, 3) = llo
  99. x.at(2, 2) = r; x = Hero
  100. x.at(0, 1) = j; x = jello
  101. x.at(He) = je; x = jello
  102. x.at(l, -1) = i; x = Helio
  103. z = x.at(r) = ello
  104. z = x.before(o) = Hell
  105. x.before(ll) = Bri; x = Brillo
  106. z = x.before(2) = He
  107. z = x.after(Hel) = lo
  108. x.after(Hel) = p; x = Help
  109. z = x.after(3) = o
  110. z =   a bc; z = z.after(RXwhite); z =a bc
  111. x.gsub(l, ll); x = Hellllo
  112. x.gsub(r, ...); x = Hello should have been replaced by this string
  113. x.gsub(RXwhite, #); x = Hello#should#have#been#replaced#by#this#string
  114. z = x+y; z.del(loworl); z = Held
  115. reverse(x) = olleH
  116. x.reverse() = olleH
  117. upcase(x) = HELLO
  118. downcase(x) = hello
  119. capitalize(x) = Hello
  120. z = replicate(*, 10) = **********
  121. z = This string    has
  122. five words
  123. from split(z, RXwhite, w, 10), n words = 5:
  124. This
  125. string
  126. has
  127. five
  128. words
  129. z = join(w, nw, /); z =This/string/has/five/words
  130. enter a word:
  131. tinteger
  132. one = 1
  133. one + 1 = 2
  134. two = 2
  135. fact30 = factorial(30) = 265252859812191058636308480000000
  136. fact28 = factorial(28) = 304888344611713860501504000000
  137. fact30 + fact28 = 265557748156802772496809984000000
  138. fact30 - fact28 = 264947971467579344775806976000000
  139. fact30 * fact28 = 80872505331661933764010628483512781121876047953920000000000000
  140. fact30 / fact28 = 870
  141. fact30 % fact28 = 0
  142. -fact30 = -265252859812191058636308480000000
  143. lg(fact30) = 107
  144. gcd(fact30, fact28) = 304888344611713860501504000000
  145. sqrt(fact30) = 16286585271694955
  146. negfact31 = -8222838654177922817725562880000000
  147. fact30 + negfact31 = -7957585794365731759089254400000000
  148. fact30 - negfact31 = 8488091513990113876361871360000000
  149. fact30 * negfact31 = -2181131468794922353615366650200339706856997013317222400000000000000
  150. fact30 / negfact31 = 0
  151. fact30 % negfact31 = 265252859812191058636308480000000
  152. gcd(fact30, negfact31) = 265252859812191058636308480000000
  153. fib50 = fibonacci(50) = 12586269025
  154. fib48 = fibonacci(48) = 4807526976
  155. fib48 + fib50 = 17393796001
  156. fib48 - fib50 = -7778742049
  157. fib48 * fib50 = 60508827864880718400
  158. fib48 / fib50 = 0
  159. fib48 % fib50 = 4807526976
  160. gcd(fib50, fib48) = 1
  161. sqrt(fib50) = 112188
  162. pow64 = Ipow(2, 64) = 18446744073709551616
  163. lg(pow64) = 64
  164. s64 = 1 << 64 = 18446744073709551616
  165. s32 = s64 >> 32 = 4294967296
  166. comps64 = ~s64 = 18446744073709551615
  167. comps64 & s32 = 4294967296
  168. comps64 | s32 = 18446744073709551615
  169. comps64 ^ s32 = 18446744069414584319
  170.  
  171. enter an Integer: number = 12345678901234567890
  172.  
  173. End of test
  174. trationa
  175. one = 1
  176. third = 1/3
  177. half = 1/2
  178. third + half = 5/6
  179. third - half = -1/6
  180. third * half = 1/6
  181. third / half = 2/3
  182. onePointTwo = 5404319552844595/4503599627370496
  183. double(onePointTwo) = 1.2
  184. a = 1
  185. a += half = 3/2
  186. a -= half = 1
  187. a *= half = 1/2
  188. a /= half = 1
  189. approxpi = 355/113
  190. double(approxpi) = 3.14159
  191. rpi = Rational(PI) = 884279719003555/281474976710656
  192. double(rpi) = 3.14159
  193. approxpi + rpi = 199847224979684595/31806672368304128
  194. approxpi - rpi = 8484881165/31806672368304128
  195. approxpi * rpi = 313919300246262025/31806672368304128
  196. approxpi / rpi = 19984723346456576/19984721649480343
  197. -approxpi = -355/113
  198. abs(negapproxpi) = 355/113
  199.  
  200. enter a Rational in form a/b or a: number = 61727839/49382716
  201. approximating e as pow(1+1/n),n) for n =10
  202. double(approxe) = 2.59374
  203. log(approxe) = 0.953102
  204. approxe = 25937424601/10000000000
  205. approximating e as pow(1+1/n),n) for n =100
  206. double(approxe) = 2.70481
  207. log(approxe) = 0.995033
  208. approxe = 270481382942152609326719471080753083367793838278100277689020104911710151430673927943945601434674459097335651375483564268312519281766832427980496322329650055217977882315938008175933291885667484249510001/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  209. approximating e as pow(1+1/n),n) for n =1000
  210. double(approxe) = 2.71692
  211. log(approxe) = 0.9995
  212. approxe = 2716923932235892457383088121947577188964315018836572803722354774868894945523768158997885697298661429053421034015406256924859461187617653889457753593083386399572063538500432650176144488046171044844121805479607648086607018742077798375087855857012278053105042704758822511824867218226931719410407150364389665913091822576819072281835735365786202176167228686198158460724641052407506305826211156964723064441295969498221919251479211700941935114755531972677360157561485144237786816579422141378066423317811515462669946309306263409027388915931082226854264858661420878279983534424128672461206356847463821364630504359665171573635397346037274752410368174877433941234543153511100471651472869116068528478976916600585383497180172395573924789047989563714318957536493108041591460911612078698461739084741934442448701416575483263891529095158013233115648534154086009312190489168546024398834243847135102411661996020129557921444666343641039137906807591342742464200991933722791531063202677650581946360422027765645970182463780273161113009717582155489902677095053354207944772439271656447869921825959042801322775729022491402012084605367784456090892987682547811360481731795980637847551788259384243997341190753089343387201753821360405430310320564488741142120089460368986590136324737459372963666586532443570474179352656517635333744783401695951969936296323256525034685525470426185224036844803487442831639483152362831735350269624668701702424450940840884555271325190876102665277858154695092765613639718577127438538649414492678358762110235621776218781360881010654696273264706319088453035858355052988808507775439561385232652305316287705653436727647681405618323757201022946801118770148072424021385261829594248369890171583993147934044232792517118743393217276416179842097554494269012251329134783596037733973478306188255291484352384699871420472711423079586319041837563678498472779422282261024744394844558738378027105699691260086532632930941478779680554645850778168703661423819000515895232903243738763481571999080702098369316199601942246247887808385073821861517636839926907458184604648942036355256683219218129910422822177336785268627274482037476294341444562207197209503659518266210432791078248321015453218019586608696207295299183111963158564162419152742807437346241667671688466998244424726765837682151606230638111654756595917019206453978024157097042546937345673337179165242325399648121877178987723999503839197328183925340949191821443698275476295245249466361817367207248089144718808572152781037112209285944844021186534832159964297181970584453756163204297111185823467744743465840230098261424789313315093951766314459027947176701489215746884363426961577348384651887153140609616362927338107686794499974902581579897076172716541504294334300741444106749994715713419630688719451362658288812132056854807330827050505064714442618243101018812153563795539024370219967801515099970721926240625418512417940854760415566229746248973756297569452302821563467574313259066016089521122779204844875998864114930516063910324359331903843040069467324167490917499501000001/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  213.  
  214. End of test
  215. tcomplex
  216. Complex one = (1, 0)
  217. i = (0, 1)
  218. neg_one = (-1, 0)
  219. sqrt(neg_one) = (0, 1)
  220. a = (2, 3)
  221. b = (4, 5)
  222. a + one = (3, 3)
  223. a - one = (1, 3)
  224. a * one = (2, 3)
  225. a / one = (2, 3)
  226. a + b = (6, 8)
  227. a - b = (-2, -2)
  228. a * b = (-7, 22)
  229. a / b = (0.560976, 0.0487805)
  230. c = a; c += b = (6, 8)
  231. c = a; c -= b = (-2, -2)
  232. c = a; c *= b = (-7, 22)
  233. c = a; c /= b = (0.560976, 0.0487805)
  234. -a = (-2, -3)
  235. real(a) = 2
  236. imag(a) = 3
  237. conj(a) = (2, -3)
  238. norm(a) = 13
  239. abs(a) = 3.60555
  240. arg(a) = 0.982794
  241. cos(a) = (-4.18963, -9.10923)
  242. sin(a) = (9.1545, -4.16891)
  243. cosh(a) = (-3.72455, 0.511823)
  244. sinh(a) = (-3.59056, 0.530921)
  245. log(a) = (1.28247, 0.982794)
  246. exp(a) = (-7.31511, 1.04274)
  247. sqrt(a) = (1.67415, 0.895977)
  248. pow(a, 2) = (-5, 12)
  249. pow(a, b) = (-0.753046, -0.986429)
  250. enter a Complex number in form (a, b) or (a) or a: number = (1.2, -34)
  251.  
  252. End of test
  253. tbitset
  254. BitSet tests:
  255. a = 0*
  256. b = 000000000010*
  257. c = 1010101010101010101010101010101010101010*
  258. c[0] =1
  259. c[1] =0
  260. c[2] =1
  261. c[3] =0
  262. c[4] =1
  263. d = 00110011001100110011001100110011001100110*
  264. e = 1111000011110000111100001111000011110*
  265. u = ~a = 1*
  266. g = ~e = 0000111100001111000011110000111100001*
  267. ~c = 0101010101010101010101010101010101010101*
  268. c & d = 0010001000100010001000100010001000100010*
  269. c | d = 10111011101110111011101110111011101110110*
  270. c - d = 10001000100010001000100010001000100010*
  271. c ^ d = 10011001100110011001100110011001100110010*
  272. f = b = 100000000010*
  273. f &= c = 100000000010*
  274. f |= d = 10110011001100110011001100110011001100110*
  275. f -= e = 00000011000000110000001100000011000000110*
  276. f ^= u = 11111100111111001111110011111100111111001*
  277. h = d
  278. :00110011001100110011001100110011001100110*
  279. h.set(0):
  280. 10110011001100110011001100110011001100110*
  281. h.set(65):
  282. 1011001100110011001100110011001100110011000000000000000000000000010*
  283. h.clear(2):
  284. 1001001100110011001100110011001100110011000000000000000000000000010*
  285. h.invert(11,20):
  286. 1001001100101100110010110011001100110011000000000000000000000000010*
  287. h.set(21,30):
  288. 1001001100101100110011111111111100110011000000000000000000000000010*
  289. h.clear(31, 40):
  290. 1001001100101100110011111111111000000000000000000000000000000000010*
  291. h.test(0,5) = 1
  292. h.test(31,40) = 0
  293. set bits in e:
  294. 0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 32 33 34 35 
  295. clear bits in g (reverse order):
  296. 35 34 33 32 27 26 25 24 19 18 17 16 11 10 9 8 3 2 1 0 
  297.  
  298. End of test.
  299. tbitstri
  300. a      = 
  301. b      = 1000000001
  302. c      = 10101010101010101010
  303. d      = 00110011001100110011
  304. e      = 11110000111100001111
  305. f = b  = 1000000001
  306. g = ~e = 00001111000011110000
  307. h = d  = 00110011001100110011
  308. bits in e:
  309. 0 1 2 3 8 9 10 11 16 17 18 19 
  310. clear bits in g (reverse order):
  311. 19 18 17 16 11 10 9 8 3 2 1 0 
  312. ~c     = 01010101010101010101
  313. c & d  = 00100010001000100010
  314. c | d  = 10111011101110111011
  315. c - d  = 10001000100010001000
  316. c ^ d  = 10011001100110011001
  317. c + d  = 1010101010101010101000110011001100110011
  318. c <<2  = 0010101010101010101010
  319. c >>2  = 101010101010101010
  320. f &= c = 1000000000
  321. f |= d = 10110011001100110011
  322. f -= e = 10000000000000000000
  323. f ^= c = 00101010101010101010
  324. f += b = 001010101010101010101000000001
  325. f <<=5 = 00000001010101010101010101000000001
  326. f >>=10= 0101010101010101000000001
  327. l = 101010101010101010100011001100110011001110101010101010101010
  328. BitPattern pat = 0011XXXX0011XXXX0011
  329. pat.pattern    = 00110011001100110011
  330. pat.mask       = 11110000111100001111
  331. l.index(pat)   = 20
  332. l.index(pat,-1)= 20
  333. l.before(pat)  = 10101010101010101010
  334. l.at(pat)      = 00110011001100110011
  335. l.after(pat)   = 10101010101010101010
  336. b.set(0)       :1000000001
  337. b.set(65):
  338. 100000000100000000000000000000000000000000000000000000000000000001
  339. b.clear(2):
  340. 100000000100000000000000000000000000000000000000000000000000000001
  341. b.invert(11,20):
  342. 100000000100111111111000000000000000000000000000000000000000000001
  343. b.set(21,30):
  344. 100000000100111111111111111111100000000000000000000000000000000001
  345. b.clear(31, 40):
  346. 100000000100111111111111111111100000000000000000000000000000000001
  347. b.set(0)       :10110011001100110011
  348. b.set(65):
  349. 101100110011001100110000000000000000000000000000000000000000000001
  350. b.clear(2):
  351. 100100110011001100110000000000000000000000000000000000000000000001
  352. b.invert(11,20):
  353. 100100110010110011001000000000000000000000000000000000000000000001
  354. b.set(21,30):
  355. 100100110010110011001111111111100000000000000000000000000000000001
  356. b.clear(31, 40):
  357. 100100110010110011001111111111100000000000000000000000000000000001
  358. k = 0101
  359. c.before(k) = 1
  360. c.at(k)     = 0101
  361. c.after(k)  = 010101010101010
  362. c.after(k)=k :101010101
  363. c.before(k)=k:010101010101
  364. reverse(k)           = 1010
  365. k.left_trim(0)       : 101
  366. k.right_trim(1)      : 10
  367. k = 0110
  368. c.before(k) = 0
  369. c.at(k)     = 0110
  370. c.after(k)  = 011001100110011
  371. c.after(k)=k :001100110
  372. c.before(k)=k:011001100110
  373. reverse(k)           = 0110
  374. k.left_trim(0)       : 110
  375. k.right_trim(1)      : 110
  376.  
  377. End of test.
  378. trandom
  379. five random ACG integers:
  380. 1525072166 1954057046 3406008937 226879594 4107049426 
  381. five random MLCG integers:
  382. 1341853672 83475514 936613571 888739672 2097844081 
  383. Binomial r1( 100, 0.50, &gen1) ...
  384. five samples:
  385. 45 52 59 49 60 
  386. Statistics for 100 samples:
  387. samples: 100 min: 40 max: 64
  388. mean: 50.78 stdDev: 4.42577 var: 19.5875 confidence(95): 0.878369
  389. Erlang r2( 2.0, 0.5, &gen1) ...
  390. five samples:
  391. 1.79909 1.92989 2.50816 2.31409 1.48158 
  392. Statistics for 100 samples:
  393. samples: 100 min: 0.592645 max: 3.81874
  394. mean: 1.96664 stdDev: 0.696406 var: 0.484981 confidence(95): 0.138213
  395. Geometric r3(&gen1, 0.5)...
  396. five samples:
  397. 3 2 2 2 3 
  398. Statistics for 100 samples:
  399. samples: 100 min: 1 max: 7
  400. mean: 1.9 stdDev: 1.28315 var: 1.64646 confidence(95): 0.254662
  401. HyperGeometric r4( 10.0, 150.0, &gen1)...
  402. five samples:
  403. 15.0752 5.25802 7.82211 20.4995 7.08199 
  404. Statistics for 100 samples:
  405. samples: 100 min: 0.0446068 max: 131.508
  406. mean: 12.6763 stdDev: 16.7567 var: 280.786 confidence(95): 3.32564
  407. NegativeExpntl r5( 1.0, &gen1)...
  408. five samples:
  409. 1.90665 0.0921974 0.219318 1.79202 0.566202 
  410. Statistics for 100 samples:
  411. samples: 100 min: 0.00794624 max: 4.23124
  412. mean: 0.927343 stdDev: 0.8869 var: 0.786592 confidence(95): 0.17602
  413. Normal r6( 0.0, 1.0, &gen1)...
  414. five samples:
  415. -0.174892 0.148871 -0.479753 0.65432 -0.92688 
  416. Statistics for 100 samples:
  417. samples: 100 min: -2.22325 max: 2.61771
  418. mean: 0.141292 stdDev: 0.972041 var: 0.944864 confidence(95): 0.192918
  419. LogNormal r7( 1.0, 1.0, &gen1)...
  420. five samples:
  421. 2.15572 0.985688 0.340019 0.959144 1.06052 
  422. Statistics for 100 samples:
  423. samples: 100 min: 0.0393323 max: 6.16358
  424. mean: 1.03547 stdDev: 0.963892 var: 0.929088 confidence(95): 0.191301
  425. Poisson r8( 2.0, &gen1)...
  426. five samples:
  427. 0 2 1 2 1 
  428. Statistics for 100 samples:
  429. samples: 100 min: 0 max: 5
  430. mean: 2 stdDev: 1.31041 var: 1.71717 confidence(95): 0.260073
  431. DiscreteUniform r9( 0.0, 1.0, &gen1)...
  432. five samples:
  433. 1 1 0 0 0 
  434. Statistics for 100 samples:
  435. samples: 100 min: 0 max: 1
  436. mean: 0.45 stdDev: 0.5 var: 0.25 confidence(95): 0.0992334
  437. Uniform r10( 0.0, 1.0, &gen1)...
  438. five samples:
  439. 0.557314 0.529968 0.997197 0.25163 0.947497 
  440. Statistics for 100 samples:
  441. samples: 100 min: 0.00205286 max: 0.997197
  442. mean: 0.518789 stdDev: 0.321429 var: 0.103317 confidence(95): 0.0637931
  443. Weibull r11( 0.5, 1.0, &gen1)...
  444. five samples:
  445. 10.4918 0.295112 0.184577 2.14799 0.10053 
  446. Statistics for 100 samples:
  447. samples: 100 min: 0.000236481 max: 15.4934
  448. mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
  449. SampleHistogram for 100 Normal samples
  450. < -4 : 0
  451. < -3.2 : 0
  452. < -2.4 : 0
  453. < -1.6 : 7
  454. < -0.8 : 15
  455. < 6.66134e-16 : 36
  456. < 0.8 : 15
  457. < 1.6 : 19
  458. < 2.4 : 7
  459. < 3.2 : 1
  460. < 4 : 0
  461. < max : 0
  462.  
  463. End of test
  464. tfix
  465. Fix: identities should be displayed
  466. [X] displays the precision of a given value
  467. [*] indicates that the full precision is not used for coding reasons
  468. 0 [16] =  0.00000 [16]
  469. .5 [16] =  0.50000 [16]
  470. -.5 [17] = -0.50000 [17]
  471. .1 [33] =  0.10000 [33]
  472. -.5 [17] = -0.50000 [17]
  473. .3 [16] =  0.29999 [16]
  474. .5 [16] =  0.50000 [16]
  475. .1 [16] =  0.09998 [16]
  476. .1 [33*] =  0.09998 [33]
  477. -.2 [17] = -0.20001 [17]
  478. -.5 [17] = -0.50000 [17]
  479. .1 [16] == .1 [33*] = 1
  480. .1 [16] == .1 [33] = 0
  481. .1 [33] != .5 [16] = 1
  482. .1 [33] > .5 [16] = 0
  483. .1 [33] <= -.2 [17] = 0
  484. 1073741824 = 1.07374e+09
  485. .5 = 0.5
  486. .5 [17] =  0.50000 [17]
  487. -.5 [17] = -0.50000 [17]
  488. .1 [33] + .5 [16] =  0.60000 [33]
  489. .1 [33] - .5 [16] = -0.40000 [33]
  490. .1 [33] * .5 [16] =  0.05000 [49]
  491. .1 [33] *  3 =  0.30000 [33]
  492. .1 [33] * -3 = -0.30000 [33]
  493. -.1 [33] *  3 = -0.30000 [33]
  494. -.1 [33] * -3 =  0.30000 [33]
  495. .5 [17] * -2 = -1.00000 [17]
  496. .1 [33] % 25 =  0.10000 [58]
  497. .1 [33] % -25 =  0.09375 [8]
  498. .1 [33] / .5 [16] =  0.20001 [33]
  499. .1 [33] << 1 =  0.20000 [33]
  500. -.1 [33] >> 2 =  0.47500 [33]
  501. abs(-.2) =  0.20001 [17]
  502. abs(.2) =  0.20001 [17]
  503. sgn(-.2) = -1
  504. sgn(.2) = 1
  505.  
  506. show .1 [33]
  507. len = 33
  508. siz = 3
  509. ref = 1
  510. man =  ccccccc8000
  511. val = 0.1
  512.  
  513. Fix: range errors warned
  514. 1.1 [16] =  0.00000 [16]
  515. .5 [16] / .1 [33] =  0.00000 [16]
  516. .5 [16] / 0. [16] =  0.00000 [16]
  517. .5 [17] * 32768 = -1.00000 [17]
  518.  
  519. Fix: overflows saturated
  520. .95 [16] + .1 [33] =  1.00000 [33]
  521. -.1 [33] - .95 [16] = -1.00000 [33]
  522. .5 [17] * 2 =  0.99998 [17]
  523.  
  524. Fix: overflows generate warnings
  525. .95 [16] + .1 [33] = -0.94999 [33]
  526. -.1 [33] - .95 [16] =  0.94999 [33]
  527. .5 [17] * 2 = -0.49994 [17]
  528. tfix16
  529. Fix16: identities should be displayed
  530. 0 = 0
  531. .5 = 0.5
  532. -.5 = -0.5
  533. .1 = 0.100006
  534. .5 = 0.5
  535. .5 = 0.5
  536. .25 = 0.25
  537. 8192 = 8192
  538. .25 = 0.25
  539. .25 = 0.25
  540. .25 = 0.25
  541. -.25 = -0.25
  542. .1 + .5 = 0.600006
  543. .1 - .5 = -0.399994
  544. .1 * .5 = 0.0500031
  545. .1 *  3 = 0.300018
  546. .1 * -3 = -0.300018
  547. .1 / .5 = 0.200012
  548. .1 << 1 = 0.200012
  549. -.5 >> 2 = -0.125
  550. .1 == .5 = 0
  551. .1 != .5 = 1
  552. .1 > .5 = 0
  553. .5 <= -.5 = 0
  554. Fix16: range errors ignored and overflows saturated
  555. 1.1 = 0.999969
  556. .7 + .5 = 0.999969
  557. -.5 - .7 = -1
  558. .5 / .1 = 0.999969
  559. Fix32: identities should be displayed
  560. 0 = 0
  561. .5 = 0.5
  562. -.5 = -0.5
  563. .1 = 0.1
  564. .5 = 0.5
  565. .5 = 0.5
  566. .25 = 0.25
  567. 536870912 = 536870912
  568. .25 = 0.25
  569. .25 = 0.25
  570. .25 = 0.25
  571. -.25 = -0.25
  572. .1 + .5 = 0.6
  573. .1 - .5 = -0.4
  574. .1 * .5 = 0.05
  575. .1 *  3 = 0.3
  576. .1 * -3 = -0.3
  577. .1 / .5 = 0.2
  578. .1 << 1 = 0.2
  579. -.5 >> 2 = -0.125
  580. .1 == .5 = 0
  581. .1 != .5 = 1
  582. .1 > .5 = 0
  583. .5 <= -.5 = 0
  584. Fix32: range errors reported and overflows reported
  585. 1.1 = 1
  586. .7 + .5 = -0.8
  587. -.5 - .7 = 0.8
  588. .5 / .1 = 1
  589. tfix24
  590. Fix24: identities should be displayed
  591. 0 = 0
  592. .5 = 0.5
  593. -.5 = -0.5
  594. .1 = 0.1
  595. .5 = 0.5
  596. .5 = 0.5
  597. .25 = 0.25
  598. 536870912 = 536870912
  599. .25 = 0.25
  600. .25 = 0.25
  601. .25 = 0.25
  602. -.25 = -0.25
  603. .1 + .5 = 0.6
  604. .1 - .5 = -0.4
  605. .1 * .5 = 0.05
  606. .1 *  3 = 0.3
  607. .1 * -3 = -0.3
  608. .1 / .5 = 0.2
  609. .1 << 1 = 0.2
  610. -.5 >> 2 = -0.125
  611. .1 == .5 = 0
  612. .1 != .5 = 1
  613. .1 > .5 = 0
  614. .5 <= -.5 = 0
  615. Fix24: range errors ignored and overflows saturated
  616. 1.1 = 1
  617. .7 + .5 = 1
  618. -.5 - .7 = -1
  619. .5 / .1 = 1
  620. Fix48: identities should be displayed
  621. 0 = 0
  622. .5 = 0.5
  623. -.5 = -0.5
  624. .1 = 0.1
  625. .5 = 0.5
  626. .5 = 0.5
  627. .25 = 0.25
  628. 536870912 = 536870912
  629. 0 = 0
  630. .25 = 0.25
  631. .25 = 0.25
  632. .25 = 0.25
  633. -.25 = -0.25
  634. .1 + .5 = 0.6
  635. .1 - .5 = -0.4
  636. .1 *  3 = 0.3
  637. .1 * -3 = -0.3
  638. .1 << 1 = 0.2
  639. -.5 >> 2 = -0.125
  640. .1 == .5 = 0
  641. .1 != .5 = 1
  642. .1 > .5 = 0
  643. .5 <= -.5 = 0
  644. Fix48: range errors reported and overflows reported
  645. 1.1 = 1
  646. .7 + .5 = -0.8
  647. -.5 - .7 = 0.8
  648.