Skip to content

Conversation

@vancucit
Copy link
Contributor

@vancucit vancucit commented Apr 2, 2023

This PR is to improvement fix this crash

#1461

Look compare float equal on not correct in some case

https://stackoverflow.com/questions/4732645/iphone-objective-c-comparing-doubles-not-working

This debug log has demonstrated this issue

if (fabs(self.scrollView.mj_insetT - insetT) > FLT_EPSILON) {
      self.scrollView.mj_insetT = insetT;
  }else{
    if (self.scrollView.mj_insetT != insetT ) {
      NSLog(@"_--------- same value dif epsilon %f  %f ", self.scrollView.mj_insetT, insetT);
    }
  }

2023-04-02 10:09:15.886546+0700 App[58013:10076967] _--------- same value dif epsilon 172.333333 172.333333

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

Successfully merging this pull request may close these issues.

2 participants