Talk:Fixed-point arithmetic

message: Is the standard notation for fixed point "1.15" or "Q1.15" ? —The preceding unsigned comment was added by DavidCary (talk • contribs) 06:53, 24 October 2005  (UTC1)
In Texas Instruments documentation I have only seen Qn notation where n is the fractional bit count. —The preceding unsigned comment was added by Petedarnell (talk • contribs) 23:28, 24 August 2006  (UTC1)
TI describes their use of "Qm.f" notation in their libraries here: http://focus.ti.com/lit/ug/spru565b/spru565b.pdf, Appendix A.2 "Fractional Q Formats", pg. A-3.
Note, that TI makes the sign bit implied.  I.e. the word length (in bits) is m+f+1.  This differs from the description in the main page which seem to say that the word length is m+f.
Would the someone kindly verify if this difference is truly a difference in common usage?
Bvacaliuc 18:35, 14 October 2006 (UTC)
thread_title:  Standard notation 

message: Should not these to be consistent? English is not my native language so somebody please help out. I find it strange that wikipedia sticks to "fixed-point arithmetic" and "floating point". Velle 12:26, 25 March 2006 (UTC)
thread_title:  "fixed-point" vs. "fixed point" and "floating-point" vs. "floating point" 

message: Tom Forsyth is a respected game developer. Here he explains why even modern games may prefer fixed point over floating point, for reasons of precision rather than speed: A matter of precision. —The preceding unsigned comment was added by 86.133.150.83 (talk • contribs) 12:02, 3 October 2006  (UTC1)
His message: use more bits; and if you want speed use integer ratios. With more bits a floating point number has no hardware support or is slower. It is a very good article. As I said below if the mantissa is the same length as the integer and you restrict yourself as you have to when using integer ratios; they both have the same accuracy.  Charles Esson 21:56, 7 April 2007 (UTC)
thread_title:  Modern games 

message: It should have this name because that is what it is refferred to in old embedded assembler programs. —The preceding unsigned comment was added by 217.154.59.122 (talk) 14:05, 19 February 2007 (UTC)
thread_title:  Name Binary scaling 

message: (a/base * b/base)/base = a*b/base
((a/base)*base/(b/base)) = (a/b)/base
a/base + b/base = (a+b)/base
etc.
This can speed things up using q numbers; that is make the base a power of 2. The formulas then become
(a/base * b/base)/shift_rightQ = a*b/base
((a/base)shift_leftQ/(b/base)) = (a/b)/base
a/base + b/base = (a+b)/base
I think Q numbers and binary scaling are the same thing being described with different words ( but I am not sure because the purist might say Q numbers have to be signed magnitude). You need to be a little careful with fixed point arithmetic; it is only the same if the radix is binary. Fixed point using a decimal radix would be a different animal.
The comment on floating point not being as accurate is wrong; if you place the same restrictions on your floating point calculations as you have to place on your calculations when doing fixed point maths and the mantissa of the floating point is of the same length as the integer the results are the same. If the floating point number has a longer mantissa than the length of the integer being used for the integer based maths the floating point result will be better. Further many integer calculations get done without proper rounding ( it still matters) the floating point unit generally does it properly.
>> Charles, for the same # of bits, say 32, fixed point is more accurate since all 32 bits of precision is used. 32 bit Floating point will only use 24 bits of precision with 8 bits of exponent. Pete Darnell 216.204.127.98 22:28, 31 May 2007 (UTC)
replies: text: IEEE 754 (and the current revision, IEEE 754r) both use the term significand for the fractional part, not mantissa.  mfc (talk) 12:10, 29 March 2008 (UTC)
thread_title: The general case is integer based arithmetic

message: No, integers (radix point immediately to the right of the LSD) are the special case, where fixed point is the general case. It seems, maybe tracing back to Fortran, computer languages supplying fixed point values with scaling other than 0 (PL/I notation) are rare. Note also that PL/I allows the scale factor, that is the digits to the right of the radix point, to be negative. In that case, they are still integers in the math sense, but it seems not in the CS sense. There is no convenient written notation for values with a negative number of digits after the decimal point. Gah4 (talk) 17:44, 10 April 2020 (UTC)
thread_title:  Special case 

message: The main article fixed point arithemetic is a confused presentation of binary based fixed point  stuff; the examples 
in the section Current common uses of fixed-point arithmetic give examples in binary and decimal base fixed point stuff.
I have to do more reading to make sure but I think the general thrust should be:
Fixed point arithmetic is the general set presented in a way that supports binary and decimal radix. Binary scaling and Q numbers have a binary base. Binary numbers probable should go to Q number.  I think Q numbers need to describe the format Qn.n at the moment it only mentions Qn which is a subset of the former. Charles Esson 21:37, 9 April 2007 (UTC)
replies: text: I'm confused. What should not be merged? --68.0.124.33 (talk) 03:37, 28 March 2008 (UTC)
thread_title: It should not be merged

message: The summary states: "Fixed-point numbers are useful for representing fractional values, usually in base 2 or base 10, when the executing processor has no floating point unit (FPU) or if fixed-point provides improved performance or accuracy for the application at hand. Most low-cost embedded microprocessors and microcontrollers do not have an FPU." The third clause is a tautology. It's saying "Fixed-point numbers are useful if fixed-point provides improved performance or accuracy for the application at hand". Asmor (talk) 16:50, 1 May 2012 (UTC)
replies: text: Seems close enough for me. According to Knuth, fixed point should be used in finance and typesetting, in both cases not because it is faster or even more accurate, but because it is more dependable (that is, consistent).  TeX uses fixed point for all quantities related to actual typeset output. Floating point is used in some error messages that don't affect the typeset results. This guarantees that the same input will generate the same typeset output on all processors. But mostly, fixed point is used for values that have an absolute uncertainty, where floating point is best for those with relative uncertainty. Gah4 (talk) 17:15, 1 November 2019 (UTC)
thread_title:  Tautology in summary 

message: It seems that there is a new merge request, even though there are two sections on merge request above.  Gah4 (talk) 17:04, 1 November 2019 (UTC)
replies: text: I suppose so, but binary scaling could use some work. It seems to be written such that scaled fix point is the poor substitute for floating point. That might be sometimes true, but even more fixed point should be used for quantities with an absolute uncertainty, and floating point for quantities with relative uncertainty.  Or maybe binary scaling should merge with the Q page.  (I will have to look at the latter.) Gah4 (talk) 15:42, 16 January 2020 (UTC)
thread_title:  new merge request 

message: I notice that the introduction to this article mentions real data type, which seems to exclude a complex data type. PL/I, at least, supports fixed point complex data, with either decimal or binary scaling. Does the article need to limit it to real? Gah4 (talk) 17:06, 1 November 2019 (UTC)
thread_title:  complex 

message: When do they teach in school bases other than 10?  I was in school during the New Math years, when we learned about different bases in 4th grade. I suspect that is gone now. Even so, though, they teach decimal fractions in some grade, but only whole numbers in other bases. The extension to fractions in other bases isn't so hard, though, but is it taught at all, in any grade?  Gah4 (talk) 18:27, 9 April 2020 (UTC)
thread_title:  [[New Math]] 

message: OK, now that the merge is done, we can go over the whole thing together. A quick look through it, it seems to mention floating point in places where floating point isn't being discussed, I suspect that is because too often the usage is wrong, and even that it is often taught wrong in schools. Too often, and even in this article, floating point means anything that isn't integer. But it is only floating if it actually floats. Fixed point decimal is still fixed point, the subject of this article. Gah4 (talk) 01:58, 25 June 2021 (UTC)
replies: text: Good point. I have now improved some of the wording from the "Binary scaling" article: https://en.wikipedia.org/w/index.php?diff=1030295346&oldid=1030289681&title=Fixed-point_arithmetic&diffmode=source Solomon Ucko (talk) 02:12, 25 June 2021 (UTC)
thread_title:  floating point 

message: Sorry for not noticing the prior discussion as to whether or not to merge... I saw https://en.wikipedia.org/wiki/Talk:Fixed-point_arithmetic#Name_Binary_scaling, as well as a few revisions on Binary scaling: https://en.wikipedia.org/w/index.php?diff=93645268&oldid=83052273&title=Binary_scaling&diffmode=source, https://en.wikipedia.org/w/index.php?diff=135233978&oldid=124073487&title=Binary_scaling&diffmode=source, https://en.wikipedia.org/w/index.php?diff=201494301&oldid=185846280&title=Binary_scaling&diffmode=source for prior discussion
However, I missed https://en.wikipedia.org/wiki/Talk:Fixed-point_arithmetic#It_should_not_be_merged, https://en.wikipedia.org/wiki/Talk:Fixed-point_arithmetic#merge, and https://en.wikipedia.org/wiki/Talk:Fixed-point_arithmetic#new_merge_request.
So far, I merged Binary scaling into its own section in this article (besides categories and See also, which got merged into the corresponding parts of this article), as well as adding a few small improvements to its wording (in a separate edit). Feel free to / let me know if I should revert any of my edits. (Including the replacement of the source page, merge banners on the talk pages, and a couple of link edits.)
I propose also merging in Q (number format) like so:
* Copy the intro and everything in Characteristics starting from "There are two conflicting notations" and stopping before "Unlike floating point numbers" into Notation
* Copy the rest of Characteristics into the intro?
* Copy Conversion into Representation
* Copy Math operations into Operations
* Merge See also (not needed in this case), Further reading, External links, and Categories (not needed in this case)
* Make sure references are dealt with properly
* In a separate edit, improve the wording to make things flow better.
* Do the rest of the steps listed in Wikipedia:Merging
* In another edit, probably split up the Binary scaling section and merge with other sections
* Afterwards, in another edit, probably split out / demarcate text/sections specific to binary or decimal, and possibly even move them into separate articles if there is enough content.
I can do it unless anyone else wants to do it or objects to it being done.
Pinging anyone involved in prior discussion, for feedback/comments: 
Please let me know if there's anything I should or shouldn't be doing, or should be doing differently, and I apologize if I made any mistakes. This is my first time doing a merge.
Solomon Ucko (talk) 02:58, 25 June 2021 (UTC)
thread_title:  Merging and restructuring proposal 

message: There is a  for: The wide availability of fast floating-point processors, with strictly standardized behavior, have greatly reduced the demand for binary fixed point support.  I suspect the bigger reason is that not so many people know about it. According to Knuth two things that should always be done in fixed point are finance and typesetting. (He wrote that while working on TeX.) A large number of algorithms, mostly not those related to physical sciences, work best in fixed point. That is where the rounding, when needed, can be depended on to go the right way. It is also common in digital signal processing. The article also suggests that it is easy to implement using integer arithmetic on systems that don't supply scaled fixed point. That would be true if the system supply multiply with double length product, and divide with double length dividend, as pretty much all hardware includes. But they don't, and it isn't. Gah4 (talk) 00:02, 21 October 2021 (UTC)
thread_title:  ''The wide availability of fast floating-point processors, with strictly standardized behavior, have greatly reduced the demand for binary fixed point support.'' 

message: Knuth has suggested that only fixed point arithmetic be used for typesetting and finance. I believe that some finance calculations, such as interest, are required to be done in fixed point, with specific rounding rules. Probably should fine the WP:RS for those. And TeX uses only fixed point for calculations affecting the typeset output. Floating point is used for some error messages. Gah4 (talk) 07:46, 18 March 2024 (UTC)
thread_title:  [[Donald Knuth|Knuth]] 

message: I pity the poor soul who is hoping to learn something useful from the Detailed examples section.  To be blunt, it is a mess, both in terms of composition and information presented.  In fact, much of this article is poorly-written and in several places, clearly shows signs of opinion and original research.
:216.152.18.132 (talk) 05:31, 23 May 2024 (UTC)
thread_title:  Detailed examples