Repository: mhostetter/galois

Issue:
galois.is_irreducible(poly) seems to return some false negatives in large odd exponent GFs
Hi Matt, hope all is well.

Even though it works fine for other groups (e.g. even groups likes GF(2^256) work well), still I 've been getting the following false negative result when using the galois.is_irreducible(poly) over odd groups tο produce irreducible polynomials over GF(2^233). 

For example, we know from previous publications and research that x^233+x^74+1 is irreducible over GF(2) for creating the quotient ring of GF(2^233) but the following code returns Null for every polynomial (including the aforementioned one):
```
def loop_init_trinomial():
    #initial detection loop
    for k in range(1, 233):
        poly = galois.Poly.Degrees([233, k, 0])
        if galois.is_irreducible(poly):
            print("Found one: ", k, poly, poly.string)
```
Care to share some thoughts?

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter) Report
> Merging [#361](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter) (e9a56d4) into [master](https://codecov.io/gh/mhostetter/galois/commit/c5d930dad1cddad7d708dbe39b8ebd7e245717af?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter) (c5d930d) will **not change** coverage.
> The diff coverage is `100.00%`.

```diff
@@           Coverage Diff           @@
##           master     #361   +/-   ##
=======================================
  Coverage   96.76%   96.76%           
=======================================
  Files          41       41           
  Lines        5225     5225           
=======================================
  Hits         5056     5056           
  Misses        169      169           
```


| [Impacted Files](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter) | Coverage Δ | |
|---|---|---|
| [galois/\_polys/\_poly.py](https://codecov.io/gh/mhostetter/galois/pull/361/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter#diff-Z2Fsb2lzL19wb2x5cy9fcG9seS5weQ==) | `95.77% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter). Last update [c5d930d...e9a56d4](https://codecov.io/gh/mhostetter/galois/pull/361?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matt+Hostetter).


Patch:
diff --git a/galois/_polys/_poly.py b/galois/_polys/_poly.py
index 182703a7d..3d7c9bf76 100644
--- a/galois/_polys/_poly.py
+++ b/galois/_polys/_poly.py
@@ -1513,7 +1513,7 @@ class Poly:
                 if self._nonzero_degrees.size == 0:
                     self._degree = 0
                 else:
-                    self._degree = max(self._nonzero_degrees)
+                    self._degree = int(max(self._nonzero_degrees))
             elif hasattr(self, "_integer"):
                 if self._integer == 0:
                     self._degree = 0


Test patch:
diff --git a/tests/polys/test_irreducible_polys.py b/tests/polys/test_irreducible_polys.py
index f3aefef69..de10d0934 100644
--- a/tests/polys/test_irreducible_polys.py
+++ b/tests/polys/test_irreducible_polys.py
@@ -111,3 +111,11 @@ def test_irreducible_polys_exceptions():
 def test_irreducible_polys(order, degree):
     LUT = eval(f"IRREDUCIBLE_POLYS_{order}_{degree}")
     assert [f.coeffs.tolist() for f in galois.irreducible_polys(order, degree)] == LUT
+
+
+def test_large_degree():
+    """
+    See https://github.com/mhostetter/galois/issues/360.
+    """
+    f = galois.Poly.Degrees([233, 74, 0])
+    assert galois.is_irreducible(f)