Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

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.

Amal

Members
  • Joined

  • Last visited

Everything posted by Amal

  1. Amal replied to OvermindDL1's topic in Suggestions
    Hi. "How ever it might be, all benchmarks (and all threads about it on the web) clearly indicate that these days it is better to use Math.sin over any custom made version. Something often called: premature optimizations." (TrueBrain) It might not be the case if you use this: sourceforge.net/projects/jafama (has tables but they are small, so memory fetching might not be too large of an overhead) Remarks about MathHelper sin code: SIN_TABLE[(int)(par0 * 1024 / Math.PI / 2.0f) & 1023] 1) There are two divisions. Divisions are expensive, but here you can remove them. -> SIN_TABLE[(int)(par0 * 1024 * (1.0/(2*Math.PI))) & 1023] 2) Operations are done from left to right (if same priority), and you have a constant on the right, so you can add parentheses to end up with only one operation (HotSpot is smart enough to figure out constants). -> SIN_TABLE[(int)(par0 * (1024*(1.0/(2*Math.PI)))) & 1023] -> SIN_TABLE[(int)(par0 * (1024/(2.0*Math.PI))) & 1023] ->This should go way faster. 3) It would also be fine to only add parentheses since then the divisions will only occur once (also, 2.0f will be turned into a double, since it divides a double): -> SIN_TABLE[(int)(par0 * (1024 / Math.PI / 2.0f)) & 1023]

Important Information

By using this site, you agree to our Terms of Use.

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.