diff --git a/rle_array/array.py b/rle_array/array.py
index 915e6c2..896fe99 100644
--- a/rle_array/array.py
+++ b/rle_array/array.py
@@ -457,7 +457,7 @@ class RLEArray(ExtensionArray):
         if n == 0:
             return self.dtype.na_value
         else:
-            return np.dot(data, lengths) / self.dtype._dtype.type(n)
+            return np.dot(data, lengths) / np.float64(n)
 
     def median(
         self, skipna: bool = True, axis: Optional[int] = 0, out: Any = None

Bug with `mean` using your `README` demo
Hi there. Thanks for this interesting extension, I'm thinking of using it in an upcoming conference talk. I've spent most of this year talking on High Performance Python (I'm co-author of the O'Reilly publication with this name) and for an upcoming talk I'd like to include RLE as an example of compression. Past talks here if you're curious: https://ianozsvald.com/

I've used your `README` demo and I see that performance is often the same (or a little slower) for compressed data but on one test I've had a failure. `df.month.mean() != df_rle.month.mean()` as `df_rel.month.mean() -> np.inf` (which it shouldn't).

Specifically:
```
In [29]: df.month.mean()
Out[29]: 6.2505
In [30]: df_rle.month.mean() 
/home/ian/workspace/scratch/.../rle-array-master/rle_array/array.py:460: RuntimeWarning: divide by zero encountered in long_scalars   return np.dot(data, lengths) / self.dtype._dtype.type(n)
Out[30]: inf
```

Some other tests are fine:
```
df.month.sum() == df_rle.month.sum()  # True
df.month.std() == df_rle.month.std()  # True
```

Here's my DataFrame configuration:
```
In [50]: df_rle.month.value_counts()                                                                                                                                                                                                          
/home/ian/workspace/scratch/.../rle-array-master/rle_array/array.py:372: PerformanceWarning: performance: __array__ blows up data
  warnings.warn("performance: __array__ blows up data", PerformanceWarning)
Out[50]: 
1     372000
3     372000
5     372000
4     360000
6     344000
2     340000
7     310000
8     310000
10    310000
12    310000
9     300000
11    300000
Name: month, dtype: int64

In [52]: df_rle.info()                                                                                                                                                                                                                        
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 4000000 entries, 0 to 3999999
Data columns (total 8 columns):
 #   Column    Dtype           
---  ------    -----           
 0   date      datetime64[ns]  
 1   month     RLEDtype[int8]  
 2   year      RLEDtype[int16] 
 3   city      RLEDtype[object]
 4   country   RLEDtype[object]
 5   avg_temp  float32         
 6   rain      RLEDtype[bool]  
 7   mood      RLEDtype[object]
dtypes: RLEDtype[bool](1), RLEDtype[int16](1), RLEDtype[int8](1), RLEDtype[object](3), datetime64[ns](1), float32(1)
memory usage: 69.6 MB
```

Version information:

```
In [22]: pd.show_versions()                                                                                                                                                                                                                   
/home/ian/miniconda3/envs/.../lib/python3.7/site-packages/setuptools/distutils_patch.py:26: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  "Distutils was imported before Setuptools. This usage is discouraged "

INSTALLED VERSIONS
------------------
commit           : None
python           : 3.7.8.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.6.7-050607-generic
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_GB.UTF-8
LOCALE           : en_GB.UTF-8

pandas           : 1.0.5
numpy            : 1.19.1
pytz             : 2020.1
dateutil         : 2.8.1
pip              : 20.1.1
setuptools       : 49.2.0.post20200712
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 2.11.2
IPython          : 7.16.1
pandas_datareader: None
bs4              : None
bottleneck       : None
fastparquet      : None
gcsfs            : None
lxml.etree       : None
matplotlib       : None
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pytables         : None
pytest           : None
pyxlsb           : None
s3fs             : None
scipy            : None
sqlalchemy       : None
tables           : None
tabulate         : None
xarray           : None
xlrd             : None
xlwt             : None
xlsxwriter       : None
numba            : 0.50.1
```
diff --git a/test-requirements.txt b/test-requirements.txt
index 43ac36b..9032352 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,8 +1,8 @@
 asv
 black==19.10b0
 flake8-mutable==1.2.0
-flake8==3.8.3
-isort==5.0.9
+flake8==3.8.2
+isort==4.3.21
 mypy
 pytest
 pytest-cov
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index 7027b2f..e55e9ee 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -15,3 +15,9 @@ def test_object_isna():
     actual = array.isna()
     expected = np.asarray([False, True])
     npt.assert_equal(actual, expected)
+
+
+def test_mean_divisor_overflow():
+    # https://github.com/JDASoftwareGroup/rle-array/issues/22
+    array = RLEArray._from_sequence([1] * 256, dtype=np.uint8)
+    assert array.mean() == 1

pip install -e .[testing]
parse_log_pytest
requirements.txt
asv black==19.10b0 flake8-mutable==1.2.0 flake8==3.8.3 isort==5.0.9 mypy pytest pytest-cov setuptools_scm sphinx
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
appdirs==1.4.4
asv==0.5.1
attrs==22.2.0
Babel==2.11.0
black==19.10b0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
docutils==0.18.1
flake8==3.8.3
flake8-mutable==1.2.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
isort==5.0.9
Jinja2==3.0.3
llvmlite==0.36.0
MarkupSafe==2.0.1
mccabe==0.6.1
mypy==0.971
mypy-extensions==1.0.0
numba==0.53.1
numpy==1.19.5
packaging==21.3
pandas==1.1.5
pathspec==0.9.0
pluggy==1.0.0
py==1.11.0
pycodestyle==2.6.0
pyflakes==2.2.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
python-dateutil==2.9.0.post0
pytz==2025.2
regex==2023.8.8
requests==2.27.1
-e git+https://github.com/JDASoftwareGroup/rle-array.git@d3b9a22ab96c7c5dc22e80e0773ca742c6809635#egg=rle_array
setuptools-scm==6.4.2
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml==0.10.2
tomli==1.2.3
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: rle-array
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - appdirs==1.4.4
      - asv==0.5.1
      - attrs==22.2.0
      - babel==2.11.0
      - black==19.10b0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - docutils==0.18.1
      - flake8==3.8.3
      - flake8-mutable==1.2.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isort==5.0.9
      - jinja2==3.0.3
      - llvmlite==0.36.0
      - markupsafe==2.0.1
      - mccabe==0.6.1
      - mypy==0.971
      - mypy-extensions==1.0.0
      - numba==0.53.1
      - numpy==1.19.5
      - packaging==21.3
      - pandas==1.1.5
      - pathspec==0.9.0
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.6.0
      - pyflakes==2.2.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - regex==2023.8.8
      - requests==2.27.1
      - setuptools-scm==6.4.2
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - toml==0.10.2
      - tomli==1.2.3
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/rle-array

tests/test_regressions.py::test_mean_divisor_overflow
tests/test_regressions.py::test_object_isna
rle_array/array.py
rle_array/array.py