1

I'm wondering if Excel VBA stores doubles with different levels of precision in 32 vs 64 bit editions of the product.

The reason I'm asking is that I'm looking at a stochastic model, and I've noted that I'm getting very small differences in output using seeded random numbers (difference would be implied by a difference in a trigger threshold in roughly 1 in 200M numbers).

The code based is identical, so I wasn't sure if there's additional precision in 64 which might be causing a delta in probability threshold conditions with a vanishingly small level of occurrence vs the run in 32.

Looking at the VBA documentation, I couldn't see any specific call outs on precision, but I'm aware that with that documentation, just because something is written down doesn't mean there isn't something there!

NWhittle
  • 131
  • 5
  • Is it not a case of the seeding in 64 vs 32 rather than the storage of a double? – jamheadart Jun 23 '20 at 11:12
  • I'd suggest to read this: [Compatibility between the 32-bit and 64-bit versions of Office](https://docs.microsoft.com/en-us/office/client-developer/shared/compatibility-between-the-32-bit-and-64-bit-versions-of-office). VBA7 enables you to run macro with 2 conditional compilations. Using `Win64` directive you can "force" your code to run in 64bit mode. More at: [64-bit Visual Basic for Applications overview](https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/64-bit-visual-basic-for-applications-overview). I doubt that result may differ in 32/64 bit environment. – Maciej Los Jun 23 '20 at 11:27

1 Answers1

2

No - excel uses the same precision for doubles in both 32 and 64 bit Excel.

Charles Williams
  • 23,121
  • 5
  • 38
  • 38