DIRECTORY Commander, RealConvert, Ieee, IO, Rope; TestRealConvert: CEDAR PROGRAM IMPORTS Commander, RealConvert, IO ~ BEGIN IEEE: TYPE ~ Ieee.SingleReal; BCPL: TYPE ~ RealConvert.BcplReal; GetRopeFromReal: PUBLIC PROC [r: REAL] RETURNS [returnRope: Rope.ROPE] ~ { returnRope ¬ IO.PutFLR["%e is %x hex, and %x BCPL hex, and %e back to real.\n", LIST[ IO.real[r], IO.int[LOOPHOLE[r]], IO.int[LOOPHOLE[RealConvert.IeeeToBcpl[r]]], IO.real[RealConvert.BcplToIeee[RealConvert.IeeeToBcpl[r]]]]]; }; TestCommander: Commander.CommandProc ~ { s: IO.STREAM = IO.RIS[cmd.commandLine]; number: REAL = IO.GetReal[s]; IO.PutRope[cmd.out, GetRopeFromReal[number]]; }; Commander.Register["TestReal", TestCommander, "Print out real values before and after conversions."]; END. . TestRealConvert.mesa Copyright Σ 1989, 1991 by Xerox Corporation. All rights reserved. weiser, January 13, 1991 Test the RealConvert interface for PCedar Weiser, January 13, 1991 10:50 pm PST Michael Plass, September 27, 1991 12:32 pm PDT Prints out in Hex the BCPL value of a REAL passed in ΚΈ–(cedarcode) style•NewlineDelimiter ™code•Mark outsideHeaderšœ™Kšœ Οeœ7™BKšœ™K™K™)K™%K™.K™—šΟk ˜ Kšœ ˜ Kšœ ˜ K˜Kšžœ˜Kšœ˜—K˜KšΡblnœžœž˜Kšžœž˜"K˜Kšœž˜˜Kšžœžœ˜Kšžœžœ˜"—˜K˜š Οnœžœžœžœžœžœ˜JK™4šœ žœAžœ˜UKšžœ ˜ Kšžœžœ˜Kšžœžœ˜,Kšžœ;˜=—K˜K˜—š  œ˜(Kš œžœžœžœžœ˜'Kšœžœžœ ˜Kšžœ+˜-—K˜K˜Kšœe˜e—K˜Kšžœ˜K˜—…—θ