![]() T ) return Result end Extr - unit :: LFT function Unit return LFT is begin - unit = (1,0,0,1) return LFT '( Q => One, R => Zero, S => Zero, T => One ) end Unit - comp :: LFT -> LFT -> LFT function Comp ( T1, T2 : LFT ) return LFT is use Big_Integers begin - comp (q,r,s,t) (u,v,w,x) = (q*u+r*w,q*v+r*x,s*u+t*w,s*v+t*x) return LFT '( Q => T1. Set_Denominator ( Item => Result, New_Value => T. ![]() R, Canonicalize => False ) Big_Rationals. ![]() Set_Numerator ( Item => Result, New_Value => T. To_Big_Integer ( 10 ) - type LFT = (Integer, Integer, Integer, Integer type LFT is record Q, R, S, T : Big_Integer end record - extr :: LFT -> Integer -> Rational function Extr ( T : LFT X : Big_Integer ) return Big_Rational is use Big_Integers Result : Big_Rational begin - extr (q,r,s,t) x = ((fromInteger q) * x + (fromInteger r)) / - ((fromInteger s) * x + (fromInteger t)) Big_Rationals. To_Big_Integer ( 4 ) Ten : constant Big_Integer := Int_To_Big. To_Big_Integer ( 3 ) Four : constant Big_Integer := Int_To_Big. To_Big_Integer ( 2 ) Three : constant Big_Integer := Int_To_Big. To_Big_Integer ( 1 ) Two : constant Big_Integer := Int_To_Big. To_Big_Integer ( 0 ) One : constant Big_Integer := Int_To_Big. With Ada.Command_Line with Ada.Text_IO with GNU_Multiple_Precision.Big_Integers with GNU_Multiple_Precision.Big_Rationals use GNU_Multiple_Precision procedure Pi_Digits is type Int is mod 2 ** 64 package Int_To_Big is new Big_Integers.Modular_Conversions (Int ) - constants Zero : constant Big_Integer := Int_To_Big. UNPK XDEC,PACKED packed decimal to zoned printable LOOPI2 C R6,=A(NBUF) do i=2 to hbound(buf)ĬVD R2,PACKED convert v to packed decimal UNPK PG(1),PACKED packed decimal to zoned printable ![]() LA R10,VECT-4(R1) EQU * do j=hbound(vect) to 1 by -1ĬVD R1,PACKED convert buf(1) to packed decimal LOOPI1 C R6,=A(NBUF) do i=1 to hbound(buf) ![]()
0 Comments
Leave a Reply. |