Comp Sci Computer Arithmetic for Double Precision Numbers

AI Thread Summary
The discussion centers on evaluating the expression (1-a)(1+a) in double precision, specifically identifying values of 'a' for which it equals 1. It is established that the expression evaluates to 1 when 'a' is 0 and also when 'a' is 1/n for positive integers n. Clarification is sought regarding the appropriate data representation, with a focus on double precision as defined by the IEEE 754 binary64 standard. The conversation highlights a misunderstanding about fixed-point versus floating-point representations. The thread concludes with a request for further clarification on similar expressions in double precision.
ver_mathstats
Messages
258
Reaction score
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
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
 
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?"
 
Back
Top