Bug in nexttoward/2 and/or float/1

Seems there are very few where this happens. Maybe this
helps tracking down the cause? Or maybe this is a known
artefact of something? I started with a simulation of mpz_get_d/2:

mpz_get_d(X, Y) :-
    M is msb(X),
    mpz_get_d(M, X, Y).

mpz_get_d(M, X, Y) :-
    M < 53, !, Y is float(X).
mpz_get_d(M, X, Y) :-
    Y is float(X>>(M-52))*(1<<(M-52)).

And then I checked whether mpz_get_d/2 behaves as float/1
in SWI-Prolog 8.5.17. And it depends how I cast it, whether I
compute N^10 inside the float argument or outside:

?- aggregate_all(count, (between(1,1000000,N),
    A is N^10, mpz_get_d(A,B), B =\= float(N^10)), C).
C = 0.

?- aggregate_all(count, (between(1,1000000,N),
    A is N^10, mpz_get_d(A,B), B =\= float(A)), C).
C = 8.