faslan Posted February 27, 2014 Posted February 27, 2014 1)A^2-B^2 WE CAN WRITE THIS AS (A+B)(A-B) but if A,B are two floating point numbers these calculations may yield different results why this under what circumstances does a difference between two calculators arise 2)why it's hard to ( time and hardware complexity )to add two floating point numbers than integer numbers 3) is my examples right or wrong integers = 25 ,-14, 11bin, A7Hex,17octfloating points 12.14 -7.33 -11.11bin 74.12 oct
mooeypoo Posted February 28, 2014 Posted February 28, 2014 ! Moderator Note Moved to homework help. faslan, can you give us a bit more explanation on what you already tried to do and where you got stuck?
mathematic Posted February 28, 2014 Posted February 28, 2014 Floating point numbers in the computer are represented with a finite number of bits (double precision - 64). When multiplying two numbers the product would require more than 64 bits. The extra ones are dropped, so the result is not exact.
Sensei Posted March 1, 2014 Posted March 1, 2014 (edited) Floating point numbers in the computer are represented with a finite number of bits (double precision - 64). When multiplying two numbers the product would require more than 64 bits. The extra ones are dropped, so the result is not exact. Quite the same can be said about integers - too big integer will cause overflow and completely wrong result. In machine code it can be detected by checking overflow flag in CPU status register. http://en.wikipedia.org/wiki/Overflow_flag But in high level languages, not possible to detect a posteriori. Edited March 1, 2014 by Sensei
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now