I was just reading around, I need my ARM project to make its calculations as precise as possible. I’m wondering:
Are quadruple precision floating-point format numbers supported in the ARM GNU GCC tools? I think the type is “long double” in C++.
How does the execution speed become affected? 2 times slower than a regular “double”? 4 times slower? What about the difference in speed between ARM7TDMI and ARM Cortex M3?
What kind of datatype do scientific calculators use (a $30 one)? What would software such as Maple or Wolfram use?
Also, how do I figure out the largest whole integer that is representable by a floating precision number without losing any precision? Is it determined by 2^n where n is the number of bits in the significand?
It’s a calculator, user puts expression in, number comes out, the user would expect the number to be as accurate as the last decimal place being displayed to them
whether or not the application of the calculation requires such accuracy is irrelevant
edit: somebody suggested http://gmplib.org , supposedly I can simply typedef my number datatypes to its datatypes, configure the precision, and its C++ wrapper will overload the operators, I just need to figure out how to compile it, it seems complicated. I can always stick to double, make sure everything else works, and then upgrade the precision.
The calculators I have seen perform all math as BCD numbers. No floating point. In general a floating point number consist of mantissa (the number) and an exponent. I believe that in the standard IEEE floating point number the exponent is base 2. This makes representing integers exactly nearly imposable.