java - BigInteger loop executing infinitely -


  जबकि (सही) {if (((d.multiply (e))। Mod (phi1))। बराबर (बिगइंटेजर.ऑन) ब्रेक; d.add (BigInteger.ONE); }  

मेरे पास मेरे प्रोग्राम में निम्न कोड है, जिसका अर्थ है कि

  जबकि (सच) {if ((d * e)% phil == 1) ब्रेक; घ ++; }  

यहां, ई = 17 , phil = 12816 और d = 1 शुरू में।

लेकिन लंबे समय तक प्रतीक्षा करने के बाद भी, पाश अभी भी कार्यान्वित हो रहा है। क्या गलती हो सकती है?

बिगइंटेगर अपरिवर्तनीय है और उस पर सभी कार्रवाइयां मौजूदा एक को संशोधित करने के बजाय एक नया उदाहरण लौटें इस प्रकार d.add (BigInteger.ONE); d का मान नहीं बदलता।

समस्या को ठीक करने के लिए लिखें: d = D.add (BigInteger.ONE);


Comments

Popular posts from this blog

c# - Highlight all words containing a letter in a richtextbox -

Admob interstitials not clickable on Nexus 5 (Android 4.4.2) -

c# - Given the DayOfWeek number, find the date of a day in the previous week -