05-13-2021, 06:29 PM
New version 4.2
For the 65.3 assigned key.
\<< "Version 4.2
1 single Arg like
\[]'7/3*'
\[] or {'7/3*' 300}
for 300 digits
" DROP DUP TYPE 5 ==
IF
THEN OBJ\-> DROP
ELSE 100 "Put above 200 if
you want by default
200 digits & not 100" DROP
END SWAP DUP UNROT 0 0 0 RCLF \-> digit x1 x2 x21 num f
\<< RAD STD -3 CF -105 CF x1 \->STR "." "" SREPL 0 ==
IF
THEN DROP
ELSE OBJ\-> 'x2' STO x2 x1 / \->NUM LOG DUP FP 0 \=/
IF
THEN DROP "Instead of decimals (ab.c),
Try fractions
('abc/10') !" DOERR
END \->STR "." "" SREPL DROP OBJ\-> ALOG 'x21' STO
IF x21 1 >
THEN x2 x21 /
ELSE
IF x21 1 <
THEN x2 x21 INV *
ELSE x2
END
END \->STR "." "" SREPL DROP OBJ\->
END DUP EXPAND DUP2 SAME DROPN DUP \->NUM DUP 'num' STO num ABS 100000000000 > num FP 0 \=/ OR
IF
THEN OVER 10 digit ^ * PROPFRAC PROPFRAC -105 SF DUP TYPE 9 ==
IF
THEN OBJ\-> 3 DROPN
END
ELSE DROP
END f STOF
\>>
\>>
65.3 ASN
You can chose how many digits have to be shown when executing '73-6/82*4/3' ROOT2.
Instead of writing the above, give as argument
{'73-6/82*4/3' 400} ROOT2 if you want 400 digits.
Regards,
Gil
For the 65.3 assigned key.
\<< "Version 4.2
1 single Arg like
\[]'7/3*'
\[] or {'7/3*' 300}
for 300 digits
" DROP DUP TYPE 5 ==
IF
THEN OBJ\-> DROP
ELSE 100 "Put above 200 if
you want by default
200 digits & not 100" DROP
END SWAP DUP UNROT 0 0 0 RCLF \-> digit x1 x2 x21 num f
\<< RAD STD -3 CF -105 CF x1 \->STR "." "" SREPL 0 ==
IF
THEN DROP
ELSE OBJ\-> 'x2' STO x2 x1 / \->NUM LOG DUP FP 0 \=/
IF
THEN DROP "Instead of decimals (ab.c),
Try fractions
('abc/10') !" DOERR
END \->STR "." "" SREPL DROP OBJ\-> ALOG 'x21' STO
IF x21 1 >
THEN x2 x21 /
ELSE
IF x21 1 <
THEN x2 x21 INV *
ELSE x2
END
END \->STR "." "" SREPL DROP OBJ\->
END DUP EXPAND DUP2 SAME DROPN DUP \->NUM DUP 'num' STO num ABS 100000000000 > num FP 0 \=/ OR
IF
THEN OVER 10 digit ^ * PROPFRAC PROPFRAC -105 SF DUP TYPE 9 ==
IF
THEN OBJ\-> 3 DROPN
END
ELSE DROP
END f STOF
\>>
\>>
65.3 ASN
You can chose how many digits have to be shown when executing '73-6/82*4/3' ROOT2.
Instead of writing the above, give as argument
{'73-6/82*4/3' 400} ROOT2 if you want 400 digits.
Regards,
Gil