Windows (apparently all of them) have a problem with certain [floating point] math routines. Will this be resolved in ROS or must it stay in place to be truly Windows compatible?
The problem has exists in Windows such that when this formula is computed "Square Root of 4 minus 2" by any Windows application  Calc, Excel, etc, the result is expected to be zero. Square root of 4 is 2, subtract 2, equals zero. However, windows computes this answer as 8.1648465955514287168521180122928e39, which is incredibly small, but not zero. I'm not sure if this is even software; is the FPU in the CPU somehow to blame? The problem may be in the way roots are processed. Windows displays the "square root of 4" as 2, but it's held in its registers as something like 1.9999999999999999999999999999999999999999999999999999999, so when subtracting the integer 2 it becomes that 8.... stuff.
ROS math routines
Moderator: Moderator Team
Re: ROS math routines
This is not something we can really solve. Only programs themselves can organise formulas in a stable way.
uses Ubuntu+GNOME 3 GNU/Linux
likes Free (as in freedom) and Open Source Detergents
favors open source of Windows 10 under GPL2
likes Free (as in freedom) and Open Source Detergents
favors open source of Windows 10 under GPL2
Re: ROS math routines
You are correct, yosimtysam. The discrepancy is due to the way roots are processed in digital computers. Digital computers can only represent a finite number of values and those values must themselves have a finite representation. This limits the possible values that a digital computer can represent. Values a digital computer cannot represent exactly are adjusted to a value the digital computer can represent. This can cause the digital computer's results to be inaccurate. Designers of digital computers choose methods of representing numbers based on the practical needs of users for precision and accuracy, speed of computation, and cost.
 EmuandCo
 Developer
 Posts: 4473
 Joined: Sun Nov 28, 2004 7:52 pm
 Location: Germany, Bavaria, Steinfeld
 Contact:
Re: ROS math routines
I would say this is a coding error and nothing more. The precision of the FPU is well known and to output a result with waaaay more decimal places than the precision would be able to calculate + not rounding if maybe needed is a problem of the coder IMO.
ReactOS is still in alpha stage, meaning it is not featurecomplete and is recommended only for evaluation and testing purposes

 Posts: 1787
 Joined: Fri Aug 07, 2009 5:11 am
 Location: USA
Re: ROS math routines
My goodness! I'm using a Dell Dimension 4700 right now because I think the motherboard (Intel X79 chipset) is bad in my nicer PC. This machine has XP on it. It tried it both in regular mode and scientific mode. In scientific mode, there is no square root key, but you can use "inverse square" for square root, and sure enough, in either mode, that long 8 ^ 39th number was the result. Even using parenthesis in scientific mode to box in the inverse square from the subtraction, the result is still that long odd negative number. I have no idea if that will be different in ROS.
As a side comment, I used to hack around with calculators. For instance, on many solar calculators with no off button, if you hold down 2 certain numbers at the same time, it functions as an off switch.
As a side comment, I used to hack around with calculators. For instance, on many solar calculators with no off button, if you hold down 2 certain numbers at the same time, it functions as an off switch.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest