• Aucun résultat trouvé

= trial trial =

N/A
N/A
Protected

Academic year: 2022

Partager "= trial trial ="

Copied!
2
0
0

Texte intégral

(1)

DOUBLE.MESA 30-MAR-78 14:47:33 Page 1

-- Double.Mesa Edited by Sandman on August 11. 1977 2:59 PM DIRECTORY

DoubleDefs: FROM "doubledefs".

InlineDefs: FROM "inlinedefs".

StringDefs: FROM "StringDefs";

DEFINITIONS FROM InlineDefs. DoubleDefs;

Double: PROGRAM IMPORTS StringDefs EXPORTS DoubleDefs PUBLIC BEGIN

DDivide: PROCEDURE [num. den: LongCARDINAL]

RETURNS [quotient. remainder: LongCARDINAL]

BEGIN

qq. count: CARDINAL;

lTemp: LongCARDINAL;

IF den.highbits

=

0 THEN BEGIN

[quotient.highbits. qq] ~

LongDivMod[[lowbits:num.highbits.highbits:O].den.lowbits];

[quotient.lowbits. remainder.lowbits] ~

LongDivMod[[lowbits:num.lowbits.highbits:qq].den.lowbits];

remainder.highbits ~ 0;

END ELSE

BEGIN count ~ 0;

quotient.highbits ~ 0;

lTemp ~ den;

WHILE lTemp.highbits # 0 DO -- normalize lTemp.lowbits ~

BITSHIFT[lTemp.lowbits.-1] + BITSHIFT[lTemp.highbits.15];

lTemp.highbits ~ BITSHIFT[lTemp.highbits.-1];

count ~ count + 1;

ENDLOOP;

qq ~ LongDiv[num.1Temp.lowbits]; -- trial quotient qq ~ BITSHIFT[qq.-count];

lTemp ~ LongMult[den.lowbits.qq]; -- multiply by trial quotient lTemp.highbits ~ lTemp.highbits + den.highbits*qq;

UNTIL DCompare[lTemp. num] # greater DO

-- decrease quotient until product is small enough lTemp ~ DSub[lTemp.den];

qq ~ qq - 1;

ENDLOOP;

quotient.lowbits ~ qq;

remainder ~ DSub[num.1Temp];

END;

RETURN END;

DMultiply: PROCEDURE [a.b: LongCARDINAL]

RETURNS [product: LongCARDINAL] = BEGIN

product ~ LongMult[a.lowbits. b.lowbits];

product.highbits ~

product.highbits + a.lowbits*b.highbits + a.highbits*b.lowbits;

RETURN END;

DAdd: PROCEDURE [a.b: LongCARDINAL] RETURNS [LongCARDINAL]

BEGIN

t: CARDINAL = a.lowbits;

a. lowbits ~ a.lowbits + b.lowbits;

a.highbits ~ a.highbits + b.highbits;

IF a.lowbits

<

t THEN a.highbits ~ a.highbits+1;

RETURN[a]

END;

DSub: PROCEDURE [a.b: LongCARDINAL] RETURNS [LongCARDINAL]

BEGIN

t: CARDINAL

=

a.lowbits;

a. lowbits ~ a.lowbits - b.lowbits;

a.highbits ~ a.highbits - b.highbits;

IF a.lowbits

>

t THEN a.highbits ~ a.highbits-1;

RETURN[a]

(2)

DOUBLE. MESA 30-MAR-78 14:47:33

END;

DNeg: PROCEDURE [a: LongCARDINAL] RETURNS [LongCARDINAL]

=

BEGIN

IF (a.lowbits ~ -a.lowbits)

=

0 THEN a.highbits ~ -a.highbits ELSE a.highbits ~ BITNOT[a.highbits];

RETURN[a];

END;

DIne: PROCEDURE [a: LongCARDINAL] RETURNS [LongCARDINAL]

BEGIN

IF (a.lowbits ~ a.lowbits + 1)

=

0 THEN

a.highbits ~ a.highbits + 1;

RETURN[a]

END;

DCompare: PROCEDURE [a,b: LongCARDINAL] RETURNS [Comparison]

BEGIN

IF a

=

b THEN RETURN[equal];

RETURN[SELECT a.highbits FROM

<

b.highbits =) less,

) b.highbits =) greater, ENDCASE =)

IF a.10wbits

<

b.10wbits THEN less ELSE greater]

END;

AppendDouble: PROCEDURE [s: STRING, a: LongCARDINAL]

BEGIN OPEN StringDefs;

10ngZero: LongCARDINAL

=

[highbits:O, 10wbits:0];

10ng10: LongCARDINAL [highbits:O, 10wbits:10];

xn: PROCEDURE = BEGIN

eharZero: CARDINAL LOOPHOLE['O];

r: LongCARDINAL;

IF a # longZero THEN BEGIN

[a, r] ~ DDivide[a, 10ng10];

xn[];

AppendChar[s, lOOPHOLE[r.1owbits+eharZero, CHARACTER]];

END;

END;

IF a = 10ngZero THEN AppendChar[s, '0] ELSE xn[];

RETURN

END; --AppendDouble END ...

Page 2

Références

Documents relatifs

However, some serious ques- tions arise when looking at the “unexpected” high hem- orrhagic stroke rates in the warfarin arms of these trials (RELY [Randomized

(a) to analyze the effectiveness of a 12-week multicomponent treatment (nature activity therapy for fibromyalgia, NAT-FM) based on the same therapeutic components described above

Tou- tefois la validité externe de cette étude bien conduite ne permet pas d'introduire cette option au vu de la différence dans les populations de femmes

Pour analyser les échanges commerciaux de 53 pays (ou groupes de pays), il y a lieu de choisir une méthode de représentation gaphique des matrices

When you create a ‘website or blog’ project, you can directly add or change your content directly in Artisteer, and at the same time, you can also define a style for the

IMPORTS AllocDefs, SegmentDefs, StringDefs, SystemDefs EXPORTS SymbolTableDefs. CONTROL Symbol Cache •

IMPORTS RectangleDefs, StreamDefs, StringDefs, SystemDefs, WindowDefs EXPORTS MenuDefs,

Compiler: CONFIGURATION LINKS: CODE CONTROL BootNewCompiler