home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 July / Macworld (1999-07).dmg / Shareware World / Info / For Developers / Mops 3.4.sea / Mops source / Extras / FP test < prev    next >
MacBinary  |  1993-11-04  |  2.1 KB  |  [TEXT/MSET]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: FP test

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Nov 4 18:05:26 1993, modified Thu Nov 4 18:05:26 1993, creator 'MSET', type ASCII, 1557 bytes "FP test" , at 0x695 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MSET]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 46 50 20 74 65 73 | 74 00 00 00 00 00 00 00 |..FP tes|t.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 53 45 | 54 01 00 00 00 00 00 00 |.TEXTMSE|T.......|
|00000050| 00 00 00 00 00 06 15 00 | 00 01 1e a8 ff 3b 36 a8 |........|.....;6.|
|00000060| ff 3b 36 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.;6.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 bd 16 00 00 |........|........|
|00000080| 5c 20 46 50 20 74 65 73 | 74 2e 0d 2b 65 63 68 6f |\ FP tes|t..+echo|
|00000090| 0d 0d 32 2e 33 09 66 76 | 61 6c 75 65 09 46 56 0d |..2.3.fv|alue.FV.|
|000000a0| 0d 31 2e 32 09 66 63 6f | 6e 09 46 43 0d 0d 5c 20 |.1.2.fco|n.FC..\ |
|000000b0| 4f 6e 65 20 77 61 79 20 | 74 6f 20 74 65 73 74 20 |One way |to test |
|000000c0| 6f 75 72 20 46 50 20 6f | 70 73 20 69 73 20 74 6f |our FP o|ps is to|
|000000d0| 20 64 6f 20 61 20 6e 75 | 6d 62 65 72 20 6f 66 20 | do a nu|mber of |
|000000e0| 63 61 6c 63 75 6c 61 74 | 69 6f 6e 73 20 77 69 74 |calculat|ions wit|
|000000f0| 68 0d 5c 20 77 69 74 68 | 20 61 20 6b 6e 6f 77 6e |h.\ with| a known|
|00000100| 20 72 65 73 75 6c 74 20 | 61 74 20 74 68 65 20 65 | result |at the e|
|00000110| 6e 64 2e 20 20 54 68 65 | 20 63 61 6c 63 75 6c 61 |nd. The| calcula|
|00000120| 74 69 6f 6e 73 20 73 68 | 6f 75 6c 64 20 62 65 20 |tions sh|ould be |
|00000130| 73 69 6d 70 6c 65 0d 5c | 20 65 6e 6f 75 67 68 20 |simple.\| enough |
|00000140| 74 68 61 74 20 69 66 20 | 77 65 20 67 65 74 20 74 |that if |we get t|
|00000150| 68 65 20 77 72 6f 6e 67 | 20 61 6e 73 77 65 72 2c |he wrong| answer,|
|00000160| 20 77 65 27 76 65 20 67 | 6f 74 20 61 20 66 69 67 | we've g|ot a fig|
|00000170| 68 74 69 6e 67 20 63 68 | 61 6e 63 65 0d 5c 20 6f |hting ch|ance.\ o|
|00000180| 66 20 66 69 6e 64 69 6e | 67 20 77 68 65 72 65 20 |f findin|g where |
|00000190| 74 68 69 6e 67 73 20 77 | 65 6e 74 20 77 72 6f 6e |things w|ent wron|
|000001a0| 67 2e 20 20 53 6f 20 68 | 65 72 65 20 77 65 20 63 |g. So h|ere we c|
|000001b0| 68 65 63 6b 20 74 68 61 | 74 0d 5c 20 73 69 6e 2a |heck tha|t.\ sin*|
|000001c0| 2a 32 20 28 78 29 20 2b | 20 63 6f 73 2a 2a 32 20 |*2 (x) +| cos**2 |
|000001d0| 28 78 29 20 3d 20 31 2e | 20 20 57 65 20 73 71 75 |(x) = 1.| We squ|
|000001e0| 61 72 65 20 74 68 65 20 | 73 69 6e 65 20 61 6e 64 |are the |sine and|
|000001f0| 20 63 6f 73 20 69 6e 20 | 74 77 6f 0d 5c 20 64 69 | cos in |two.\ di|
|00000200| 66 66 65 72 65 6e 74 20 | 77 61 79 73 20 61 6e 64 |fferent |ways and|
|00000210| 20 75 73 65 20 64 69 66 | 66 65 72 65 6e 74 20 6f | use dif|ferent o|
|00000220| 70 65 72 61 6e 64 20 6d | 6f 64 65 73 2c 20 69 6e |perand m|odes, in|
|00000230| 20 74 68 65 20 68 6f 70 | 65 20 74 68 61 74 20 61 | the hop|e that a|
|00000240| 6e 79 0d 5c 20 62 75 67 | 73 20 69 6e 20 74 68 65 |ny.\ bug|s in the|
|00000250| 20 6f 70 65 72 61 6e 64 | 20 61 63 63 65 73 73 69 | operand| accessi|
|00000260| 6e 67 20 77 69 6c 6c 20 | 73 68 6f 77 20 74 68 65 |ng will |show the|
|00000270| 6d 73 65 6c 76 65 73 2e | 20 20 41 6c 73 6f 20 65 |mselves.| Also e|
|00000280| 78 74 72 61 20 64 75 6d | 6d 79 0d 5c 20 6c 6f 63 |xtra dum|my.\ loc|
|00000290| 61 6c 20 76 61 72 69 61 | 62 6c 65 73 20 63 61 6e |al varia|bles can|
|000002a0| 20 62 65 20 61 64 64 65 | 64 20 6f 72 20 72 65 6d | be adde|d or rem|
|000002b0| 6f 76 65 64 2c 20 74 6f | 20 74 65 73 74 20 63 6f |oved, to| test co|
|000002c0| 72 72 65 63 74 20 75 73 | 65 20 6f 66 20 74 68 65 |rrect us|e of the|
|000002d0| 0d 5c 20 45 78 74 72 61 | 4c 6f 63 61 6c 73 20 61 |.\ Extra|Locals a|
|000002e0| 72 65 61 20 76 65 72 73 | 75 73 20 74 68 65 20 44 |rea vers|us the D|
|000002f0| 20 72 65 67 73 20 61 6e | 64 20 46 50 20 72 65 67 | regs an|d FP reg|
|00000300| 73 2e 0d 0d 3a 20 51 20 | 20 7b 20 25 61 6e 67 6c |s...: Q | { %angl|
|00000310| 65 20 5c 20 25 74 65 6d | 70 31 20 25 74 65 6d 70 |e \ %tem|p1 %temp|
|00000320| 32 20 25 74 65 6d 70 33 | 20 25 74 65 6d 70 34 20 |2 %temp3| %temp4 |
|00000330| 25 71 20 25 71 32 20 25 | 71 33 20 25 71 34 20 2d |%q %q2 %|q3 %q4 -|
|00000340| 2d 20 62 20 7d 0d 09 25 | 61 6e 67 6c 65 20 73 69 |- b }..%|angle si|
|00000350| 6e 20 20 2d 3e 20 25 74 | 65 6d 70 31 0d 09 25 61 |n -> %t|emp1..%a|
|00000360| 6e 67 6c 65 20 63 6f 73 | 20 20 2d 3e 20 25 74 65 |ngle cos| -> %te|
|00000370| 6d 70 32 0d 09 25 74 65 | 6d 70 31 20 25 74 65 6d |mp2..%te|mp1 %tem|
|00000380| 70 31 20 66 2a 20 20 2d | 3e 20 25 74 65 6d 70 33 |p1 f* -|> %temp3|
|00000390| 0d 09 25 74 65 6d 70 32 | 20 66 64 75 70 20 66 2a |..%temp2| fdup f*|
|000003a0| 20 2d 3e 20 25 74 65 6d | 70 34 0d 09 25 74 65 6d | -> %tem|p4..%tem|
|000003b0| 70 33 20 20 25 74 65 6d | 70 34 20 20 66 2b 0d 09 |p3 %tem|p4 f+..|
|000003c0| 31 2e 30 20 66 2d 0d 09 | 30 2e 30 30 30 30 30 30 |1.0 f-..|0.000000|
|000003d0| 30 30 31 20 66 3c 20 69 | 66 20 20 74 72 75 65 20 |001 f< i|f true |
|000003e0| 20 65 6c 73 65 20 20 66 | 61 6c 73 65 20 20 74 68 | else f|alse th|
|000003f0| 65 6e 20 20 3b 0d 0d 3a | 20 54 45 53 54 31 0d 09 |en ;..:| TEST1..|
|00000400| 30 2e 32 20 71 20 20 2e | 20 20 20 20 72 6f 6f 6d |0.2 q .| room|
|00000410| 3a 20 66 6c 74 6d 65 6d | 20 20 2e 20 20 20 20 3b |: fltmem| . ;|
|00000420| 09 5c 20 53 68 6f 75 6c | 64 20 70 72 69 6e 74 20 |.\ Shoul|d print |
|00000430| 20 2d 31 20 31 30 30 0d | 0d 0d 5c 20 48 65 72 65 | -1 100.|..\ Here|
|00000440| 27 73 20 61 20 74 69 6d | 69 6e 67 20 74 65 73 74 |'s a tim|ing test|
|00000450| 3a 0d 0d 3a 20 54 45 53 | 54 32 20 20 7b 20 5c 20 |:..: TES|T2 { \ |
|00000460| 25 61 20 25 62 20 25 63 | 20 25 64 20 2d 2d 20 7d |%a %b %c| %d -- }|
|00000470| 0d 09 67 6c 6f 62 61 6c | 20 74 69 63 6b 73 20 40 |..global| ticks @|
|00000480| 0d 09 31 30 30 2e 20 2d | 3e 20 25 61 20 20 32 30 |..100. -|> %a 20|
|00000490| 30 2e 20 2d 3e 20 25 62 | 20 20 33 30 30 2e 20 2d |0. -> %b| 300. -|
|000004a0| 3e 20 25 63 20 20 34 30 | 30 2e 20 2d 3e 20 25 64 |> %c 40|0. -> %d|
|000004b0| 0d 09 31 30 30 30 30 30 | 20 30 20 44 4f 0d 09 09 |..100000| 0 DO...|
|000004c0| 25 61 20 25 62 20 66 2a | 20 20 25 63 20 25 64 20 |%a %b f*| %c %d |
|000004d0| 66 2a 20 20 66 2b 0d 09 | 09 25 61 20 25 64 20 66 |f* f+..|.%a %d f|
|000004e0| 2b 20 20 66 2f 20 20 2d | 3e 20 66 76 0d 09 4c 4f |+ f/ -|> fv..LO|
|000004f0| 4f 50 0d 09 67 6c 6f 62 | 61 6c 20 74 69 63 6b 73 |OP..glob|al ticks|
|00000500| 20 40 20 2d 20 6e 65 67 | 61 74 65 20 2e 20 20 2e | @ - neg|ate . .|
|00000510| 22 20 20 74 69 63 6b 73 | 22 20 63 72 20 20 66 76 |" ticks|" cr fv|
|00000520| 20 65 2e 0d 09 33 20 62 | 65 65 70 20 20 3b 0d 0d | e...3 b|eep ;..|
|00000530| 5c 20 54 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 76 |\ The or|iginal v|
|00000540| 65 72 73 69 6f 6e 20 6f | 66 20 74 68 69 73 20 74 |ersion o|f this t|
|00000550| 65 73 74 20 28 49 20 6b | 65 65 70 20 6d 6f 64 69 |est (I k|eep modi|
|00000560| 66 79 69 6e 67 20 69 74 | 29 20 74 6f 6f 6b 0d 5c |fying it|) took.\|
|00000570| 20 36 30 20 73 65 63 73 | 2e 20 6f 6e 20 61 20 49 | 60 secs|. on a I|
|00000580| 49 73 69 20 28 32 30 20 | 4d 48 7a 20 36 38 30 33 |Isi (20 |MHz 6803|
|00000590| 30 29 20 77 69 74 68 6f | 75 74 20 46 50 55 2e 20 |0) witho|ut FPU. |
|000005a0| 20 57 69 74 68 20 46 50 | 55 2c 20 62 75 74 0d 5c | With FP|U, but.\|
|000005b0| 20 73 74 69 6c 6c 20 75 | 73 69 6e 67 20 53 41 4e | still u|sing SAN|
|000005c0| 45 3a 20 34 35 20 73 65 | 63 73 2e 20 20 28 53 41 |E: 45 se|cs. (SA|
|000005d0| 4e 45 20 68 61 73 20 61 | 20 6c 6f 74 20 6f 66 20 |NE has a| lot of |
|000005e0| 6f 76 65 72 68 65 61 64 | 2e 29 20 20 57 69 74 68 |overhead|.) With|
|000005f0| 20 6e 6f 72 6d 61 6c 0d | 5c 20 72 75 6e 2d 74 69 | normal.|\ run-ti|
|00000600| 6d 65 20 46 50 55 20 64 | 65 74 65 63 74 69 6f 6e |me FPU d|etection|
|00000610| 20 66 72 6f 6d 20 4d 6f | 70 73 3a 20 31 34 2e 39 | from Mo|ps: 14.9|
|00000620| 20 73 65 63 73 2e 20 20 | 57 69 74 68 20 63 6f 6d | secs. |With com|
|00000630| 70 69 6c 65 64 20 28 6f | 70 74 69 6d 69 7a 65 64 |piled (o|ptimized|
|00000640| 29 0d 5c 20 46 50 55 20 | 63 6f 64 65 20 69 6e 20 |).\ FPU |code in |
|00000650| 4d 6f 70 73 3a 20 33 2e | 31 20 73 65 63 73 2e 20 |Mops: 3.|1 secs. |
|00000660| 20 54 68 65 20 68 61 6e | 64 2d 63 6f 64 65 64 20 | The han|d-coded |
|00000670| 61 73 73 65 6d 62 6c 79 | 20 65 71 75 69 76 61 6c |assembly| equival|
|00000680| 65 6e 74 20 74 6f 6f 6b | 0d 5c 20 31 2e 35 20 73 |ent took|.\ 1.5 s|
|00000690| 65 63 73 2e 0d 00 00 00 | 00 00 00 00 00 00 00 00 |ecs.....|........|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000710| 73 20 73 6f 75 72 63 65 | 63 65 65 6d 73 00 00 00 |s source|ceems...|
|00000720| 00 00 00 00 84 00 00 0c | 00 01 d9 60 00 00 00 00 |........|...`....|
|00000730| 07 46 50 20 74 65 73 74 | 02 00 00 00 50 61 72 74 |.FP test|....Part|
|00000740| 53 49 54 21 00 00 00 00 | 00 00 00 00 00 01 81 d5 |SIT!....|........|
|00000750| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 b3 66 c2 71 00 00 | 00 00 00 00 01 1e 00 00 |...f.q..|........|
|00000780| 00 12 ff fc 00 00 02 51 | 06 4d 6f 70 73 20 c4 75 |.......Q|.Mops .u|
|00000790| 72 63 65 72 63 65 65 6d | 73 00 00 00 00 00 00 00 |rcerceem|s.......|
|000007a0| 84 00 00 0c 00 01 d9 60 | 00 0c 00 00 00 00 00 00 |.......`|........|
|000007b0| 00 00 e0 00 0a 00 ff 00 | 00 00 00 36 00 00 00 12 |........|...6....|
|000007c0| ff fc 00 00 00 02 07 47 | 65 6e 65 72 61 6c 72 63 |.......G|eneralrc|
|000007d0| 65 72 63 65 65 6d 73 00 | 00 00 00 00 00 00 84 00 |erceems.|........|
|000007e0| 00 0c 00 01 d9 60 ff ff | 00 00 00 00 00 00 00 00 |.....`..|........|
|000007f0| 60 00 04 00 ff 00 00 00 | 00 36 00 00 00 11 00 00 |`.......|.6......|
|00000800| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000810| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+