Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Float bit manipulation?

Featured Replies

  • Author
  • Localization

mecha_yodzilla, posted Tue May 03, 2022 8:22 pm (71393)


I've been going through the binary for a PS2 game, and really often the same thing comes up in the decompilation:
Code:
if ((byte)((uint)) float_var >> 0x17) < 0x9e) {
   //some code
}


I cannot for the life of me figure out what this is trying to understand about any given float. Any insight would be much appreciated. If it helps, this has shown up around code I know is used for the rotation of the camera.
  • Author
  • Localization

aluigi, posted Wed May 04, 2022 6:06 am (71396)


In IEEE 754 that exact part of bits is the sign (1) plus the exponent (8) so I suppose that instruction simply checks if the float number is less or equal than the maximum positive 32bit signed integer (0x7fffffff.0).

Indeed 0x9e
  • Author
  • Localization

mecha_yodzilla, posted Wed May 04, 2022 3:18 pm (71400)


Thank you, that makes everything so much clearer!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.