Computer Arithmetic for Double Precision Numbers

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 1K views
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?"