Test failure in i686 with version 1.3.1

### Describe the bug

During the build of scikit-learn for Fedora Linux, I'm obtaining an error runing the tests in i686. The test that fails is:

`sklearn/tree/tests/test_export.py::test_graphviz_toy`

### Steps/Code to Reproduce

In a i686 machine

```
pytest sklearn/tree/tests/test_export.py
```

### Expected Results

Test passes

### Actual Results

```
sklearn/tree/tests/test_export.py::test_graphviz_toy FAILED              [ 93%]
=================================== FAILURES ===================================
______________________________ test_graphviz_toy _______________________________
    def test_graphviz_toy():
        # Check correctness of export_graphviz
        clf = DecisionTreeClassifier(
            max_depth=3, min_samples_split=2, criterion="gini", random_state=2
        )
        clf.fit(X, y)
    
        # Test export code
        contents1 = export_graphviz(clf, out_file=None)
        contents2 = (
            "digraph Tree {\n"
            'node [shape=box, fontname="helvetica"] ;\n'
            'edge [fontname="helvetica"] ;\n'
            '0 [label="x[0] <= 0.0\\ngini = 0.5\\nsamples = 6\\n'
            'value = [3, 3]"] ;\n'
            '1 [label="gini = 0.0\\nsamples = 3\\nvalue = [3, 0]"] ;\n'
            "0 -> 1 [labeldistance=2.5, labelangle=45, "
            'headlabel="True"] ;\n'
            '2 [label="gini = 0.0\\nsamples = 3\\nvalue = [0, 3]"] ;\n'
            "0 -> 2 [labeldistance=2.5, labelangle=-45, "
            'headlabel="False"] ;\n'
            "}"
        )
    
        assert contents1 == contents2
    
        # Test plot_options
        contents1 = export_graphviz(
            clf,
            filled=True,
            impurity=False,
            proportion=True,
            special_characters=True,
            rounded=True,
            out_file=None,
            fontname="sans",
        )
        contents2 = (
            "digraph Tree {\n"
            'node [shape=box, style="filled, rounded", color="black", '
            'fontname="sans"] ;\n'
            'edge [fontname="sans"] ;\n'
            "0 [label=<x<SUB>0</SUB> &le; 0.0<br/>samples = 100.0%<br/>"
            'value = [0.5, 0.5]>, fillcolor="#ffffff"] ;\n'
            "1 [label=<samples = 50.0%<br/>value = [1.0, 0.0]>, "
            'fillcolor="#e58139"] ;\n'
            "0 -> 1 [labeldistance=2.5, labelangle=45, "
            'headlabel="True"] ;\n'
            "2 [label=<samples = 50.0%<br/>value = [0.0, 1.0]>, "
            'fillcolor="#399de5"] ;\n'
            "0 -> 2 [labeldistance=2.5, labelangle=-45, "
            'headlabel="False"] ;\n'
            "}"
        )
    
        assert contents1 == contents2
    
        # Test max_depth
        contents1 = export_graphviz(clf, max_depth=0, class_names=True, out_file=None)
        contents2 = (
            "digraph Tree {\n"
            'node [shape=box, fontname="helvetica"] ;\n'
            'edge [fontname="helvetica"] ;\n'
            '0 [label="x[0] <= 0.0\\ngini = 0.5\\nsamples = 6\\n'
            'value = [3, 3]\\nclass = y[0]"] ;\n'
            '1 [label="(...)"] ;\n'
            "0 -> 1 ;\n"
            '2 [label="(...)"] ;\n'
            "0 -> 2 ;\n"
            "}"
        )
    
        assert contents1 == contents2
    
        # Test max_depth with plot_options
        contents1 = export_graphviz(
            clf, max_depth=0, filled=True, out_file=None, node_ids=True
        )
        contents2 = (
            "digraph Tree {\n"
            'node [shape=box, style="filled", color="black", '
            'fontname="helvetica"] ;\n'
            'edge [fontname="helvetica"] ;\n'
            '0 [label="node #0\\nx[0] <= 0.0\\ngini = 0.5\\n'
            'samples = 6\\nvalue = [3, 3]", fillcolor="#ffffff"] ;\n'
            '1 [label="(...)", fillcolor="#C0C0C0"] ;\n'
            "0 -> 1 ;\n"
            '2 [label="(...)", fillcolor="#C0C0C0"] ;\n'
            "0 -> 2 ;\n"
            "}"
        )
    
        assert contents1 == contents2
    
        # Test multi-output with weighted samples
        clf = DecisionTreeClassifier(
            max_depth=2, min_samples_split=2, criterion="gini", random_state=2
        )
        clf = clf.fit(X, y2, sample_weight=w)
    
>       contents1 = export_graphviz(clf, filled=True, impurity=False, out_file=None)
sklearn/tree/tests/test_export.py:131: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sklearn/utils/_param_validation.py:211: in wrapper
    return func(*args, **kwargs)
sklearn/tree/_export.py:905: in export_graphviz
    exporter.export(decision_tree)
sklearn/tree/_export.py:465: in export
    self.recurse(decision_tree.tree_, 0, criterion=decision_tree.criterion)
sklearn/tree/_export.py:528: in recurse
    ', fillcolor="%s"' % self.get_fill_color(tree, node_id)
sklearn/tree/_export.py:285: in get_fill_color
    return self.get_color(node_val)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <sklearn.tree._export._DOTTreeExporter object at 0xc5080408>
value = -0.4691358024691358
    def get_color(self, value):
        # Find the appropriate color & intensity for a node
        if self.colors["bounds"] is None:
            # Classification tree
            color = list(self.colors["rgb"][np.argmax(value)])
            sorted_values = sorted(value, reverse=True)
            if len(sorted_values) == 1:
                alpha = 0.0
            else:
                alpha = (sorted_values[0] - sorted_values[1]) / (1 - sorted_values[1])
        else:
            # Regression tree or multi-output
            color = list(self.colors["rgb"][0])
            alpha = (value - self.colors["bounds"][0]) / (
                self.colors["bounds"][1] - self.colors["bounds"][0]
            )
        # compute the color as alpha against white
>       color = [int(round(alpha * c + (1 - alpha) * 255, 0)) for c in color]
E       ValueError: cannot convert float NaN to integer
```

### Versions

```shell
Version is 1.3.1
```

COMMENT:
Here's a reproducer using Docker

``` Dockerfile
FROM docker.io/debian:sid-slim

RUN apt-get update && apt-get install -y --no-install-recommends python3-sklearn python3-pytest
RUN python3 -c 'import numpy; print(numpy.show_config())'
RUN python3 -c 'import sklearn; sklearn.show_versions()'
RUN pytest /usr/lib/python3/dist-packages/sklearn/tree/tests/test_export.py
```
Name it `Dockerfile.scikit-learn`, and make an empty directory next to it: `t`, then inside that directory run `docker build --progress plain --platform i386 -f ../Dockerfile.scikit-learn`


> For further reference, could you post the output of

Yep, from the reproducer above:
```
#7 [4/6] RUN python3 -c 'import numpy; print(numpy.show_config())'
#7 0.468 /usr/lib/python3/dist-packages/numpy/__config__.py:155: UserWarning: Install `pyyaml` for better output
#7 0.468   warnings.warn("Install `pyyaml` for better output", stacklevel=1)
#7 0.469 {
#7 0.469   "Compilers": {
#7 0.469     "c": {
#7 0.469       "name": "gcc",
#7 0.469       "linker": "ld.bfd",
#7 0.469       "version": "13.2.0",
#7 0.469       "commands": "cc",
#7 0.469       "args": "-g, -O2, -Werror=implicit-function-declaration, -ffile-prefix-map=/build/reproducible-path/numpy-1.26.4+ds=., -fstack-protector-strong, -Wformat, -Werror=format-security, -Wdate-time, -D_FORTIFY_SOURCE=2",
#7 0.469       "linker args": "-Wl,-z,relro, -g, -O2, -Werror=implicit-function-declaration, -ffile-prefix-map=/build/reproducible-path/numpy-1.26.4+ds=., -fstack-protector-strong, -Wformat, -Werror=format-security, -Wdate-time, -D_FORTIFY_SOURCE=2"
#7 0.469     },
#7 0.469     "cython": {
#7 0.469       "name": "cython",
#7 0.469       "linker": "cython",
#7 0.469       "version": "3.0.10",
#7 0.469       "commands": "cython"
#7 0.469     },
#7 0.469     "c++": {
#7 0.469       "name": "gcc",
#7 0.469       "linker": "ld.bfd",
#7 0.469       "version": "13.2.0",
#7 0.469       "commands": "c++",
#7 0.469       "args": "-g, -O2, -ffile-prefix-map=/build/reproducible-path/numpy-1.26.4+ds=., -fstack-protector-strong, -Wformat, -Werror=format-security, -Wdate-time, -D_FORTIFY_SOURCE=2",
#7 0.469       "linker args": "-Wl,-z,relro, -g, -O2, -ffile-prefix-map=/build/reproducible-path/numpy-1.26.4+ds=., -fstack-protector-strong, -Wformat, -Werror=format-security, -Wdate-time, -D_FORTIFY_SOURCE=2"
#7 0.469     }
#7 0.469   },
#7 0.469   "Machine Information": {
#7 0.469     "host": {
#7 0.469       "cpu": "i686",
#7 0.469       "family": "x86",
#7 0.469       "endian": "little",
#7 0.469       "system": "linux"
#7 0.469     },
#7 0.469     "build": {
#7 0.469       "cpu": "i686",
#7 0.469       "family": "x86",
#7 0.469       "endian": "little",
#7 0.469       "system": "linux"
#7 0.469     }
#7 0.469   },
#7 0.469   "Build Dependencies": {
#7 0.469     "blas": {
#7 0.469       "name": "blas",
#7 0.469       "found": true,
#7 0.469       "version": "unknown",
#7 0.469       "detection method": "system",
#7 0.469       "include directory": "unknown",
#7 0.469       "lib directory": "unknown",
#7 0.469       "openblas configuration": "unknown",
#7 0.469       "pc file directory": "unknown"
#7 0.469     },
#7 0.469     "lapack": {
#7 0.469       "name": "lapack",
#7 0.469       "found": true,
#7 0.469       "version": "unknown",
#7 0.469       "detection method": "system",
#7 0.469       "include directory": "unknown",
#7 0.469       "lib directory": "unknown",
#7 0.469       "openblas configuration": "unknown",
#7 0.469       "pc file directory": "unknown"
#7 0.469     }
#7 0.469   },
#7 0.469   "Python Information": {
#7 0.469     "path": "/usr/bin/python3.11",
#7 0.469     "version": "3.11"
#7 0.469   },
#7 0.469   "SIMD Extensions": {
#7 0.469     "baseline": [
#7 0.469       "SSE",
#7 0.469       "SSE2"
#7 0.469     ],
#7 0.469     "found": [
#7 0.469       "SSE3",
#7 0.469       "SSSE3",
#7 0.469       "SSE41",
#7 0.469       "POPCNT",
#7 0.469       "SSE42",
#7 0.469       "AVX",
#7 0.469       "F16C",
#7 0.469       "FMA3",
#7 0.469       "AVX2"
#7 0.469     ],
#7 0.469     "not found": [
#7 0.469       "AVX512F",
#7 0.469       "AVX512CD",
#7 0.469       "AVX512_KNL",
#7 0.469       "AVX512_KNM",
#7 0.469       "AVX512_SKX",
#7 0.469       "AVX512_CLX",
#7 0.469       "AVX512_CNL",
#7 0.469       "AVX512_ICL",
#7 0.469       "AVX512_SPR"
#7 0.469     ]
#7 0.469   }
#7 0.469 }
#7 0.469 None
#7 DONE 0.5s

#8 [5/6] RUN python3 -c 'import sklearn; sklearn.show_versions()'
#8 1.049 
#8 1.049 System:
#8 1.049     python: 3.11.9 (main, Apr 10 2024, 13:16:36) [GCC 13.2.0]
#8 1.049 executable: /usr/bin/python3
#8 1.049    machine: Linux-6.1.0-18-amd64-x86_64-with-glibc2.38
#8 1.049 
#8 1.049 Python dependencies:
#8 1.049       sklearn: 1.4.2
#8 1.049           pip: None
#8 1.049    setuptools: None
#8 1.049         numpy: 1.26.4
#8 1.049         scipy: 1.12.0
#8 1.049        Cython: None
#8 1.049        pandas: None
#8 1.049    matplotlib: None
#8 1.049        joblib: 1.3.2
#8 1.049 threadpoolctl: 3.1.0
#8 1.049 
#8 1.049 Built with OpenMP: True
#8 1.049 
#8 1.049 threadpoolctl info:
#8 1.049        user_api: openmp
#8 1.049    internal_api: openmp
#8 1.049          prefix: libgomp
#8 1.049        filepath: /usr/lib/i386-linux-gnu/libgomp.so.1.0.0
#8 1.049         version: None
#8 1.049     num_threads: 8
#8 DONE 1.2s
```

Labels: Bug