| MacWindows home |


Thu, 4 Jun 1998
From: Jorg Brown
To: John Rizzo

John -

Regarding this item:

"Small FPU math bug in Virtual PC. June 2, 1998 -- Ken Kiukchi's web page discusses a Virtual PC bug in which Visual Basic reports the number 10 to the power of 4 as 9999.999999999999 instead of 10,000. Connectix confirmed that Virtual PC 1.x and 2.x has a minor bug in the way it emulates FPU (floating point unit) math. The company is working on the fix."

To clarify:

1. It's not Visual Basic that has the problem. It's a special, Japanese version of BASIC.

2. I tried just saying 10*10*10*10 (instead of 10^4) in the special version of Basic. The answer was 10,000.

3. I tried both in the BASIC that ships with Windows 95. The answer was 10,000.

4. Virtual PC uses the PowerPC's FPU to emulate the Pentium's FPU. The PowerPC uses 64-bit numbers, while the Pentium uses 80-bit numbers, so Virtual PC's calculations are not quite as accurate. To give you an idea of the accuracy: if you were using Virtual PC to calculate the national debt, AND for some reason you needed exponentiation in your calculations, AND instead of Excel or MS-BASIC, you used this Japanese version of BASIC, your total debt calculation of 5 trillion dollars would be off by less than a tenth of a cent. If you did any kind of rounding at all, you would get the correct answer.

5, For perspective, consider the Pentium math bug. If you divide 4.999999 by 14.999999, the correct answer would be 0.33333329, but the Pentium would say 0.333329. An error of this magnitude when calculating the national debt would be around 60 million dollars. Also, the Pentium math bug can be easily reproduced in a commercially available spreadsheet.

6, While it is possible that a future version of Virtual PC will give you the option of working in full 80-bit precision, this would cause many programs, including games such as Quake, to slow down by a factor of 10-100.

To sum up:

Virtual PC uses the PowerPC's 64-bit FPU to emulate the Pentium's 80-bit FPU. This sometimes causes precision errors, but the errors happen in the 16th decimal place. By design, the Pentium itself has errors in the 20th decimal place. For perspective, the infamous Pentium divide bug caused problems in the 5th decimal place. To get the extra four digits of precision would slow down FPU math in Virtual PC by at least a factor of 10.

If you or any other user can show us a real-world scenario where there is any precision loss, please let us know.

Jorg 'jbx' Brown
Virtual PC Project Lead
Connectix Corp

Editor's NOTE: you can report problems to Connectix at the company's tech support web site form, or call 970-304-9533.