Cipolla's algorithm: Difference between revisions
→{{header|Phix}}: removed bigatom (now deprecated)
(→{{header|Phix}}: added gmp version) |
(→{{header|Phix}}: removed bigatom (now deprecated)) |
||
Line 1,365:
=={{header|Phix}}==
{{trans|Kotlin}}
{{libheader|mpfr}}
{"34035243914635549601583369544560650254325084643201",▼
Obviously were you to use that in anger, you would probably rip out a few ba_sprint() and return false rather than "false", etc.▼
{{out}}▼
<pre>▼
{10,13,{"6","7","true"}}▼
{56,101,{"37","64","true"}}▼
{8218,10007,{"9872","135","true"}}▼
{8219,10007,{"0","0","false"}}▼
{331575,1000003,{"855842","144161","true"}}▼
{665165880,1000000007,{"475131702","524868305","true"}}▼
{"881398088036","1000000000039",{"791399408049","208600591990","true"}}▼
{"82563118828090362261378993957450213573687113690751","17436881171909637738621006042549786426312886309400","true"}}▼
</pre>▼
<lang Phix>include mpfr.e
Line 1,536 ⟶ 1,459:
?{n,p,cipolla(n,p)}
end for</lang>
▲Obviously were you to use that in anger, you would probably rip out a few ba_sprint() and return false rather than "false", etc.
▲{{out}}
▲<pre>
▲{10,13,{"6","7","true"}}
▲{56,101,{"37","64","true"}}
▲{8218,10007,{"9872","135","true"}}
▲{8219,10007,{"0","0","false"}}
▲{331575,1000003,{"855842","144161","true"}}
▲{665165880,1000000007,{"475131702","524868305","true"}}
▲{"881398088036","1000000000039",{"791399408049","208600591990","true"}}
▲
▲ {"82563118828090362261378993957450213573687113690751","17436881171909637738621006042549786426312886309400","true"}}
▲</pre>
=={{header|PicoLisp}}==
|