ton icon indicating copy to clipboard operation
ton copied to clipboard

Fix floating point equality comparison

Open ice-charon opened this issue 8 months ago • 2 comments

Equal comparison on floating point numbers is problematic, they cannot be easy comparable via operator== instead it should be used an epsilon. I don't find critical path (in consensus nor in full node/validator) using floating point equality comparison, here in lite-client is not a big dial but still bothers mytonctrl time-to-time.

[error]   14.04.2025, 08:09:48.592 (UTC)  <MainThread>  args: ['/usr/bin/ton/lite-client/lite-client', '--addr', '127.0.0.1:36892', '--pub', '/var/ton-work/keys/liteserver.pub', '--verbosity', '0', '--cmd', 'checkloadall 1744616128 1744618128 ']
Error: LiteClient error: [ 0][t 1][2025-04-14 08:09:48.588702271][block.cpp:1691][!testnode]    Check `total_wt >= W[a]` failed
[pid 3221836] [time 1744618188] Signal: 6

ice-charon avatar Apr 14 '25 08:04 ice-charon

Would you want me to do it in other way?

ice-charon avatar May 23 '25 05:05 ice-charon

@ElderOrb t

Rafazzzz avatar May 23 '25 05:05 Rafazzzz