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
Post a Comment