# Ticket #6835(closed defect: fixed)

Opened 4 years ago

## [with patch, positive review] Inconsistent types for degree of finite fields

Reported by: Owned by: cremona tbd minor sage-4.1.2 algebra finite field JCooley Mike Hansen John Cremona Sage 4.1.2.alpha0

### Description

Finite fields in Sage have 4 different types, depending on the characteristic and degree. There is an inconsistency in the type of the degree of the field:

```sage: k = GF(2,'b'); type(k); type(k.degree())
<class 'sage.rings.finite_field_prime_modn.FiniteField_prime_modn'>
<type 'int'>
sage: k = GF(2^10,'b'); type(k); type(k.degree())
<type 'sage.rings.finite_field_givaro.FiniteField_givaro'>
<type 'sage.rings.integer.Integer'>
sage: k = GF(2^40,'b'); type(k); type(k.degree())
<type 'sage.rings.finite_field_ntl_gf2e.FiniteField_ntl_gf2e'>
<type 'sage.rings.integer.Integer'>
sage: k = GF(3^40,'b'); type(k); type(k.degree())
<class 'sage.rings.finite_field_ext_pari.FiniteField_ext_pari'>
<type 'int'>
```

i.e. in 2 of the 4 cases the degree is an int rather than an Integer.

Patch soon.

## Change History

Applies to 4.1.1

### comment:1 Changed 4 years ago by cremona

• Summary changed from Inconsistent types for degree of finite fields to [with patch, needs review] Inconsistent types for degree of finite fields
• Authors set to John Cremona

The patch is very simple, just two lines changed (one for each type). I tested all files in sage/rings. After:

```sage: k = GF(2,'b'); type(k); type(k.degree())
<class 'sage.rings.finite_field_prime_modn.FiniteField_prime_modn'>
<type 'sage.rings.integer.Integer'>
sage: k = GF(2^10,'b'); type(k); type(k.degree())
<type 'sage.rings.finite_field_givaro.FiniteField_givaro'>
<type 'sage.rings.integer.Integer'>
sage: k = GF(2^40,'b'); type(k); type(k.degree())
<type 'sage.rings.finite_field_ntl_gf2e.FiniteField_ntl_gf2e'>
<type 'sage.rings.integer.Integer'>
sage: k = GF(3^40,'b'); type(k); type(k.degree())
<class 'sage.rings.finite_field_ext_pari.FiniteField_ext_pari'>
<type 'sage.rings.integer.Integer'>
```

### comment:2 Changed 4 years ago by mhansen

• Reviewers set to Mike Hansen
• Summary changed from [with patch, needs review] Inconsistent types for degree of finite fields to [with patch, positive review] Inconsistent types for degree of finite fields

### comment:3 Changed 4 years ago by mvngu

• Status changed from new to closed
• Resolution set to fixed
• Merged in set to Sage 4.1.2.alpha0
Note: See TracTickets for help on using tickets.