json_encode(I, _State) when is_integer(I) ->
json_encode(F, _State) when is_float(F) ->
I think that it's a bug. There is no information about such dependencies in documentation.
I also suggest eliminating this weird dependency that looks very much like a mistake while porting.