diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf32e1d..907ca2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: - otp-version: [25, 26, 27] + otp-version: [24, 25, 26, 27] os: [ubuntu-24.04] steps: diff --git a/rebar.config b/rebar.config index b964aa2..930fdad 100644 --- a/rebar.config +++ b/rebar.config @@ -1,4 +1,4 @@ -{minimum_otp_vsn, "25"}. +%{minimum_otp_vsn, "25"}. {erl_opts, [ debug_info, diff --git a/src/euneus_encoder.erl b/src/euneus_encoder.erl index 8bee8d8..dc186f2 100644 --- a/src/euneus_encoder.erl +++ b/src/euneus_encoder.erl @@ -493,8 +493,13 @@ encode_term(Term, Encode, State) -> encode_integer(Int, _Encode, _State) -> erlang:integer_to_binary(Int, 10). +-if(?OTP_RELEASE >= 25). encode_float(Float, _Encode, _State) -> erlang:float_to_binary(Float, [short]). +-else. +encode_float(Float, _Encode, _State) -> + iolist_to_binary(io_lib_format:fwrite_g(Float)). +-endif. encode_atom(true, _Encode, _State) -> <<"true">>;