Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why are SINGLE variables faster than INTEGER variables ?
#11
Quote:Apparently not always, as per the times posted above yours.  SINGLE is faster without integer division, which really blows my mind!  I really wonder what type of machine/architecture gives such results. 
Indeed, amazing. I wouldn't have thought so. - I googled it: Single-point division is faster than integer division
Quote:Yes, floating-point division can be faster than integer division under certain circumstances, especially if the processor has an efficient floating-point unit (FPU) and the hardware support for floating-point operations is optimized. However, this depends heavily on the specific hardware, the compiler used, and the exact data.

. . .

In summary:
While integer division can be faster in some cases, especially when high precision is not required or when the result needs to be rounded to an integer, floating-point division is often faster when the processor has a well-optimized FPU and the compiler adjusts the code accordingly. The actual speed depends on many factors and can therefore vary.
Reply


Messages In This Thread
RE: Why are SINGLE variables faster than INTEGER variables ? - by Kernelpanic - 06-27-2025, 04:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  _NEWIMAGE can't accept variables as dimensions? bobalooie 23 910 02-18-2026, 11:16 PM
Last Post: Unseen Machine
  generating a random number in the full range of that number? (Integer, Long) madscijr 2 641 05-01-2025, 09:11 PM
Last Post: madscijr
  testing a number's quare root is an integer and casting to a value? madscijr 22 3,374 01-29-2025, 11:12 PM
Last Post: Pete
  Determine a value is INTEGER TerryRitchie 17 3,260 07-27-2024, 05:03 PM
Last Post: Kernelpanic
  Is there a faster way to do this glow circle effect? Dav 11 2,067 06-16-2024, 11:51 PM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)