rust-brotli icon indicating copy to clipboard operation
rust-brotli copied to clipboard

Manually cleanup floatX types

Open nyurik opened this issue 1 year ago • 3 comments

  • Remove where not needed (implied)
  • Add parenthesis to make casting explicitly clear
  • Add use statement to make it cleaner
  • Cleanup logic in the bit_cost.rs - BitsEntropy, using max

nyurik avatar Mar 18 '24 15:03 nyurik

The idea here is to allow floatX to either be f32 and f64...that way I think we can guarantee bit-wise exact comparisons to google/brotli

However I believe some of the casts you have will error if floatX is defined to one of the types... I think if we want to move forward on this we will need a feature flag to test both floatX settings?

danielrh avatar Mar 25 '24 06:03 danielrh

yeah, we definitely need a feature flag for that, but even more importantly we need a CI to catch it all ;)

nyurik avatar Mar 25 '24 06:03 nyurik

I just updated the code (added float64 feature)... but guess what - it does not work even in main - so this functionality is broken regardless - not sure if these changes add much more breakage. Perhaps we should merge it and then go back once CI is ready and fix it properly?

nyurik avatar Mar 25 '24 06:03 nyurik