Computer Arithmetic for Double Precision Numbers

In summary, the expression (1-a) evaluates to 1 in double precision for values of a equal to 0 and 1/n, where n is a positive number. The data representation used is the binary64 implementation of IEEE754.
  • #1
ver_mathstats
260
21
Homework Statement
In double precision for what values of a does this expression evaluate to 1?

The expression is (1-a)(1+a).
Relevant Equations
(1-a)(1+a)
I know that this expression evaluates to 1 when a is equal to 0. Also for when a is equal to 1/n when n is a positive number, but I'm confused about how to go about this in double precision?
 
Physics news on Phys.org
  • #2
ver_mathstats said:
Homework Statement:: In double precision for what values of a does this expression evaluate to 1?

The expression is (1-a)(1+a).
Relevant Equations:: (1-a)(1+a)

I know that this expression evaluates to 1 when a is equal to 0. Also for when a is equal to 1/n when n is a positive number, but I'm confused about how to go about this in double precision?
Assuming you mean Fixed Point and not Floating Point, what data representation are you supposed to use for this problem?

https://www.mathworks.com/help/fixedpoint/ug/fixed-point-data-types_btb4ld0-1.html

1664118270438.png
 
  • #4
berkeman said:
Assuming you mean Fixed Point and not Floating Point, what data representation are you supposed to use for this problem?
The problem states "double precision" which is floating point, specifically it is the binary64 implementation of IEEE754: https://en.wikipedia.org/wiki/Double-precision_floating-point_format.

@ver_mathstats can you answer the similar question "In double precision for what values of a does ## 1 - a ## evaluate to 1?"
 

FAQ: Computer Arithmetic for Double Precision Numbers

What is the difference between single and double precision numbers in computer arithmetic?

Single precision numbers use 32 bits to represent a floating-point number, while double precision numbers use 64 bits. This allows for a larger range of numbers and increased precision in calculations for double precision numbers.

How are double precision numbers stored in computer memory?

Double precision numbers are stored using the IEEE 754 standard, which uses a sign bit, an exponent, and a significand (also known as mantissa) to represent the number. The sign bit determines if the number is positive or negative, the exponent specifies the size of the number, and the significand holds the digits of the number.

Can double precision numbers accurately represent all real numbers?

No, double precision numbers have a limited number of bits and therefore cannot accurately represent all real numbers. They can only approximate real numbers within a certain range and with a certain level of precision.

What is the advantage of using double precision numbers in scientific computing?

The advantage of using double precision numbers is that they can handle a wider range of numbers and provide more accurate results in calculations. This is especially important in scientific computing where precision and accuracy are crucial.

Are there any drawbacks to using double precision numbers?

One drawback of using double precision numbers is that they require more memory and processing power compared to single precision numbers. This can impact the performance of programs that heavily use double precision calculations.

Similar threads

Back
Top