Talk:Convert decimal number to rational: Difference between revisions

→‎inaccuracies: added human-centric vs. machine-centric comments, CBLF arithmetic. -- ~~~~
(Yes -- goes without saying in all floating point contexts)
(→‎inaccuracies: added human-centric vs. machine-centric comments, CBLF arithmetic. -- ~~~~)
Line 51:
 
: Given that floating point representation can only exactly represent fractions whose denominators are powers of 2, I think that we have to assume that an approximation is demanded here (and, frankly, this should hold -- that we are dealing with approximations -- in any context where floating point is used to represent fractions [unless all denominators are explicitly declared to be powers of 2], and also where floating point is used to represent integers which are larger than the floating point mantissa [unless, of course, the mantissa times power-of-two multiplier is explicitly declared to have sufficient precision for complete accuracy]). --[[User:Rdm|Rdm]] 20:26, 13 August 2012 (UTC)
 
:: No, not all floating point is represented in powers of two; Intel (and others) have floating point decimal instructions (but hardly anybody uses it as far as I know, PL/I may be the exception as far as languages, and I haven't looked at what PL/I uses on non-IBM hardware). I believe '''C''' has a mention of it in the language definition, but I don't believe any '''C''' language implemented it (I'm not a '''C''' expert, --- hell's bells, I'm not even a novice, but I can spell it). The REXX language uses base ten floating-point numbers, no matter what the underlying hardware can or does use. The mantissa is only limited (in REXX) by how large one wishes to make it. There is no hardware constrained limits of 16, 32, 64, 128, 256, ... 4096 ... The REXX language for the most part in regards to expressing numbers and performing arithmetic, endeavors to be human-centric, not machine-centric. It does arithmatic very much like a sentient CBLF would (that has ten fingers). (er, ... carbon-based life form.) -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:51, 13 August 2012 (UTC)