Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
32 vs 64 bit math
#1
Hi all, new to the forum, new to QB64, but have done some coding in QB.

I have a general question on the math capabilities available.  I am tied down rright now to a 32-bit Win 11 machine.  I would like to do some math operations using 64-bit integers.  Will QB 64 be able to give me the full precision of the 64-bits?  I realize that I will lose speed on the thunking from 32 to 64 bits, but I can always recompile and run on a 64-bit machine when I get access to one.

I want to start coding again since I have some forced free time so expect some more general under-the-hood type questions.
Reply
#2
You're fine -- both on the asking as many questions needed part and the math part as well.  We're happy to help and encourage folks to ask any questions they might have; no one here ever complains over stupid questions.  *Though we do complain about Pete, but that's a different type of stupid...*   Big Grin

As for the math issue, it's not an issue.  Your 32-bit machine should run and handle 64-bit math and such with the same precision and results as 64-bit systems.  In fact, most math is done on FPU math processors, with are 80-bit math handling, instead of 32 or 64!   You're welcome to post some simple test code and ask folks to share their results so you can see the precision doesn't change on your system, but I'm fairly certain you'll get the same answers between 32 and 64-bit systems.

(One caveat -- ARM systems seem to be limited to less precison than x86 or x64 systems, but you didn't ask about those.  If anyone is curious, feel free to ask @a470g about the differences, as he's just spent the last few weeks working them out so QB64PE will soon start compiling on ARM systems without many problems.)
Reply
#3
arm64 as is used on the Pi 5 and with 64-bit Pi OS has a 128-bit long double type, though that type is probably not available in QB64
Reply
#4
(05-29-2025, 01:27 PM)Jack Wrote: arm64 as is used on the Pi 5 and with 64-bit Pi OS has a 128-bit long double type, though that type is probably not available in QB64

That has to be emulated support because ARM says there is no hardware support for it - https://developer.arm.com/documentation/ka004751/1-0

If the underlying C++ compiler / RTL supports 128-bit long double, then QB64-PE will support it as well.

(05-29-2025, 10:37 AM)FCS_coder Wrote: Hi all, new to the forum, new to QB64, but have done some coding in QB.

I have a general question on the math capabilities available.  I am tied down rright now to a 32-bit Win 11 machine.  I would like to do some math operations using 64-bit integers.  Will QB 64 be able to give me the full precision of the 64-bits?  I realize that I will lose speed on the thunking from 32 to 64 bits, but I can always recompile and run on a 64-bit machine when I get access to one.

I want to start coding again since I have some forced free time so expect some more general under-the-hood type questions.

How are you running Windows 11 32-bit? As far as I know, Microsoft never released a 32-bit edition of Windows 11. Windows 10 was the last version to include one. Just curious.  Smile
Reply
#5
https://learn.microsoft.com/en-us/answer...ns-(32-and

Quote:No. Windows 11 exist in 64 bit only. There is no 32 bit version of Windows 11 available.
Reply
#6
Ooops, yeah, you're right.  It's Win 10. 

Funnily enough, it tells me I can't upgrade to 11, even though it keeps reminding me.  If I had my choice, I'd be running 7, but never look a gift horse, etc, etc...
Reply
#7
@a740g
I figured that it was emulated, but now am curious how the QB84 _Float type will behave
Reply
#8
Ooops, need a refresher on reading an entry completely before asking questions...

I had not completely read the wiki entry on INTEGER64,  I  had just seen it listed in the data types.  So 64-bit INts are useable @ full precision on 32 & 64 bit hosts no problem.  (I assume emulated on 32-bit hosts, no worries there...)  Sorry for the confusion.
Reply




Users browsing this thread: 2 Guest(s)