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

Broken decoding of big positive floats #39

Open
seriyps opened this issue Oct 14, 2024 · 1 comment
Open

Broken decoding of big positive floats #39

seriyps opened this issue Oct 14, 2024 · 1 comment

Comments

@seriyps
Copy link

seriyps commented Oct 14, 2024

Maybe I'm doing smth wrong but:

> sext:encode(2200000000.1).
<<11,255,193,48,114,26,180,0,8,1,140,230,115,0,5>>
> sext:decode(sext:encode(2200000000.1)).
** exception error: no match of right hand side value <<144,171,0,12,204,51:6>>
     in function  sext:decode_pos/3 (/Users/***l/_build/test/lib/sext/src/sext.erl, line 987)
     in call from sext:decode/1 (/Users/***/_build/test/lib/sext/src/sext.erl, line 238)

However it works for big negative floats:

> sext:encode(-2200000000.1).
<<8,255,255,255,254,255,194,96,31,255,255,255,255,124,239,
  106,127,224,8,0,115,25,140,255,250>>
> sext:decode(sext:encode(-2200000000.1)).
-2200000000.1
@uwiger
Copy link
Owner

uwiger commented Oct 25, 2024

Apologies. I've had a series of really busy weeks. Will try to get to analyzing this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants