

SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 8:37 AM
Points: 8,287,
Visits: 8,738


Hugo Kornelis (7/1/2013) [quote][b](By the way, I think real should be considered to have maximum precision six; you should always calculate with at least one more digit then the precision to limit the effect of rounding errors  at least, that's what has been taught to me in high school). Up that that point I thought your explanation was great, but here you are confusing the precision of representation with the accuracy or results. They aren't the same thing. Besides, your teachers were remiss in telling to use 1 rather than 2 or more  if you want final results accurate to N decimal places all starting values and intermediate results should be represented to a precision of at least N+2 decimal places unless the calculation to be carried out is utterly trivial. It's fine to work with N+1 places when the calculation is something rally very simple like a single multiplication, but if you are trying to compute the eigenvectors or the inverse of a 3 X 3 matrix (both calculations which are extremely common in elementary mechanics) working with N+1 places may give you horribly inaccurate results. 32bit floating point with precision 7 decimal places was intended to carry out complex calculations delivering results to a guaranteed 3 decimal places accuracy  an N+4 design rather than N+1  and of course less complex calculations to greater guaranteed accuracy.
The very earliest floating point hardware implementation (Zuse, 1941) was neither electronic nor part of a stored program computer and had much smaller precision (15 bits  so nominally decimal precision 3) and hence wasn't useful for any complex calculations unless a great lack of accuracy was acceptable.
Tom




SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 12:38 PM
Points: 2,290,
Visits: 2,545


Yes, thanks to Hugo for the detailed explanation. I agree with those who say that the Microsoft documentation could use Hugo's addition!
I think the following queries show the switchover point where the REAL number is returned as 100.
 Num1 = 99.99999 CREATE TABLE #QotD ( Num1 REAL, Num2 FLOAT );
INSERT INTO #QotD VALUES ( 99.9999961, 99.99999999997 );
SELECT * FROM #QotD;
DROP TABLE #QotD;
 Num1 = 100 CREATE TABLE #QotD ( Num1 REAL, Num2 FLOAT );
INSERT INTO #QotD VALUES ( 99.9999962, 99.99999999997 );
SELECT * FROM #QotD;
DROP TABLE #QotD;
Thanks again.
 webrunner
 "Operator! Give me the number for 911!"  Homer Simpson
"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'" Ref.: http://tkyte.blogspot.com/2009/02/sqljoke.html




SSCarpal Tunnel
Group: General Forum Members
Last Login: Today @ 4:18 PM
Points: 4,245,
Visits: 3,324


L' Eomot Inversé (7/1/2013) . . . The very earliest floating point hardware implementation (Zuse, 1941) was neither electronic nor part of a stored program computer and had much smaller precision (15 bits  so nominally decimal precision 3) and hence wasn't useful for any complex calculations unless a great lack of accuracy was acceptable. Z1 was built in 1936.
http://en.wikipedia.org/wiki/Konrad_Zuse




SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 8:37 AM
Points: 8,287,
Visits: 8,738


Revenant (7/1/2013)
L' Eomot Inversé (7/1/2013) . . . The very earliest floating point hardware implementation (Zuse, 1941) was neither electronic nor part of a stored program computer and had much smaller precision (15 bits  so nominally decimal precision 3) and hence wasn't useful for any complex calculations unless a great lack of accuracy was acceptable.Z1 was built in 1936. http://en.wikipedia.org/wiki/Konrad_Zuse I should have said "commercial hardware implementation" instead of just "hardware implementation" because I was excluding Z1 (as something that didn't really work, so not an implementation) and Z2 (as something which was only a prototype for the Z3 (and a demonstration machine for the German military), not a properly engineered machine. I don't regard the Z1 as an implementation (because it didn't often work, or so I was told).
Although construction of the Z1 started in 1936, it didn't finish until 1938 and even when finished the machining of its parts wasn't clean/accurate enough so the machine frequently went wrong (or at least so I was taught long ago). There was no working Z1 until Siemens worked with Zuse to build one that actually worked (rather than reconstructing one that worked sometimes) in the late 1980s (a valuable history project, I think). The Z2 (finished in 1941) was another oneoff prototype, with no future  it sprawled over too a large space and was very much a string and sealingwax piece of engineering  in effect it was the testbed in which some of the Z3s design was verified. The first working machine, which actually went into production, was the Z3 (also 1941), and that was the machine I meant. Although it wasn't what we today call an electronic stored program computer, it had a significant electrical component (mechanical relays) and did store program in its electromechanical store.
Zuse had patented pretty well all of what is known as Von Neumann architecture a few years before Williams and Kilburn started developing a reliable nonmechanical store for a storedprogram computer which in turn was a year or two before Von Neumann wrote his report. In fact floating point was probably the one area (apart, of course, from politics) where Von Neumann disagreed with Zuse  he was famously antifloatingpoint.
Tom




SSCarpal Tunnel
Group: General Forum Members
Last Login: Today @ 4:18 PM
Points: 4,245,
Visits: 3,324


L' Eomot Inversé (7/1/2013)
Revenant (7/1/2013)
L' Eomot Inversé (7/1/2013) . . . The very earliest floating point hardware implementation (Zuse, 1941) was neither electronic nor part of a stored program computer and had much smaller precision (15 bits  so nominally decimal precision 3) and hence wasn't useful for any complex calculations unless a great lack of accuracy was acceptable.Z1 was built in 1936. http://en.wikipedia.org/wiki/Konrad_Zuse I should have said "commercial hardware implementation" instead of just "hardware implementation" . . . Tom, as I said already several times, when you come to Redmond, or to the NW from Portland to Vancouver, we have to get together for drinks and I am buying.




SSCAddicted
Group: General Forum Members
Last Login: Tuesday, February 11, 2014 9:09 AM
Points: 483,
Visits: 242


That's an easy one but worthwhile regarding the real and float data types. Thanks.




SSChampion
Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 12,206,
Visits: 9,169





SSCertifiable
Group: General Forum Members
Last Login: Thursday, March 20, 2014 7:32 AM
Points: 5,191,
Visits: 1,368





Old Hand
Group: General Forum Members
Last Login: Monday, April 07, 2014 1:30 PM
Points: 389,
Visits: 89





Hall of Fame
Group: General Forum Members
Last Login: Wednesday, April 16, 2014 6:04 AM
Points: 3,517,
Visits: 2,606


Pretty simple question but what a good discussion. Some great explanation by Hugo.



