Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error Float-16 #96

Closed
pvalette opened this issue Sep 21, 2021 · 1 comment · Fixed by #101
Closed

Compilation Error Float-16 #96

pvalette opened this issue Sep 21, 2021 · 1 comment · Fixed by #101

Comments

@pvalette
Copy link

With the last version, we have the following error when we launch the application

== Compilation error in file lib/archethic/beacon_chain/summary.ex ==
** (CompileError) lib/archethic/beacon_chain/summary.ex:255: float requires size*unit to be 32 or 64 (default), got: 16
(elixir 1.11.2) src/elixir_bitstring.erl:165: :elixir_bitstring.expand_specs/6
(elixir 1.11.2) src/elixir_bitstring.erl:38: :elixir_bitstring.expand/7
(elixir 1.11.2) src/elixir_bitstring.erl:26: :elixir_bitstring.expand/4
(elixir 1.11.2) src/elixir_fn.erl:15: anonymous fn/4 in :elixir_fn.expand/3
(stdlib 3.14.1) lists.erl:1358: :lists.mapfoldl/3
(elixir 1.11.2) src/elixir_fn.erl:20: :elixir_fn.expand/3
(stdlib 3.14.1) lists.erl:1358: :lists.mapfoldl/3
(stdlib 3.14.1) lists.erl:1359: :lists.mapfoldl/3
(stdlib 3.14.1) lists.erl:1358: :lists.mapfoldl/3
(elixir 1.11.2) expanding macro: Kernel.|>/2
lib/archethic/beacon_chain/summary.ex:256: ArchEthic.BeaconChain.Summary.serialize/1

My version of Elixir
iex -v
Erlang/OTP 23 [erts-11.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

IEx 1.11.2 (compiled with Erlang/OTP 23)

@ghost
Copy link

ghost commented Sep 21, 2021

Hello.
Yes, it's related to Elixir and Erlang OTP version.
OTP24 brings new improvements such as encoding float with 16bits, so if you update Elixir to 1.12 and OTP 24, you should not have this issue.

But we will probably update this to avoid dealing with float, which may reduce the errors due to version and simplifying the encoding.

In any case, we will update the README to matches the right requirements for Elixir.

Thanks for the report.

@ghost ghost closed this as completed in #101 Sep 27, 2021
ghost pushed a commit that referenced this issue Sep 27, 2021
…101)

To avoid issue with arithmetic and serialization with float, we defined the decimal to be 10^8 decimals.

Fixes #96
Fixes #97
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant