The Stack Overflow podcast is back! Listen to an interview with our new CEO.
4 added 7 characters in body
source | link

Sometimes, this is a valid approach, and this is the one picked by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are either integers or distances occuringoccurring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—muchlength, much smaller than what the human eye can perceive—andperceive, and to convert all quantities into multiples of this unit. A This leads to a very important remark, is thatresult: in the typograhicaltypographical problems relying on this representation of numbers numbers, we never need to multiply two lengtheslengths together, so that loss of precision caused myby multiplications in fixed point arithmetic do not occur.

Sometimes, this is a valid approach, and this is the one picked by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are either integers or distances occuring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—much smaller than what the human eye can perceive—and to convert all quantities into multiples of this unit. A very important remark, is that in the typograhical problems relying on this representation of numbers, we never need to multiply two lengthes together, so that loss of precision caused my multiplications in fixed point arithmetic do not occur.

Sometimes, this is a valid approach, and this is the one picked by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are either integers or distances occurring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length, much smaller than what the human eye can perceive, and to convert all quantities into multiples of this unit. This leads to a very important result: in the typographical problems relying on this representation of numbers, we never need to multiply two lengths together, so that loss of precision caused by multiplications in fixed point arithmetic do not occur.

3 Insist on the value of Pi being an approximation
source | link

You seem to domake an implicit statement, according to which once we know the scale of our problem, we can use fixed point arithmetic with respect to this scale to solve that problem.

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding a system to appropriately represent all constants you need might not even be possible. Think to quantum physicits working with infinitely small particles whose speed is near the speed of light.

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 (up to the 4th decimal place) without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In the solar system setting you described, we can represent Pi with 6 decimal places, which gives a terrible accuracy when computing the circumference of a planet orbit, for instance.

  3. In a fixed point system, we need to know in advance the size of the quantity you are computing.

    Assume that we still do not know the value of the gravitational constant. We would make a lot of measures and write a computer program to find an approximation of that constant. Unfortunately, in the solar system setting you described, the gravitational constant is represented by 0, which should be the, rather useless, result of our
    computation.

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth rate.

    The most important ones are the exponential and the gamma function, which practically means that every program working with anything else than polynomials will be flawed.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly.

    This is because if we do not know a priori the size of the numbers, we cannot tell if their product will fit in the representation. That is, we would have to check manually for precision underflow before each multiplication.

You seem to do an implicit statement, according to which once we know the scale of our problem, we can use fixed point arithmetic with respect to this scale to solve that problem.

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding a system to appropriately represent all constants you need might not even be possible. Think to quantum physicits working with infinitely small particles whose speed is near the speed of light.

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In the solar system setting you described, we can represent Pi with 6 decimal places, which gives a terrible accuracy when computing the circumference of a planet orbit, for instance.

  3. In a fixed point system, we need to know in advance the size of the quantity you are computing.

    Assume that we still do not know the value of the gravitational constant. We would make a lot of measures and write a computer program to find an approximation of that constant. Unfortunately, in the solar system setting you described, the gravitational constant is represented by 0, which should be the, rather useless, result of our
    computation.

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth rate.

    The most important ones are the exponential and the gamma function, which practically means that every program working with anything else than polynomials will be flawed.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly.

    This is because if we do not know a priori the size of the numbers, we cannot tell if their product will fit in the representation. That is, we would have to check manually for precision underflow before each multiplication.

You seem to make an implicit statement, according to which once we know the scale of our problem, we can use fixed point arithmetic with respect to this scale to solve that problem.

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding a system to appropriately represent all constants you need might not even be possible. Think to quantum physicits working with infinitely small particles whose speed is near the speed of light.

  2. There exists mathematical unitless constants.

    The value of Pi 3.1415 (up to the 4th decimal place) without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In the solar system setting you described, we can represent Pi with 6 decimal places, which gives a terrible accuracy when computing the circumference of a planet orbit, for instance.

  3. In a fixed point system, we need to know in advance the size of the quantity you are computing.

    Assume that we still do not know the value of the gravitational constant. We would make a lot of measures and write a computer program to find an approximation of that constant. Unfortunately, in the solar system setting you described, the gravitational constant is represented by 0, which should be the, rather useless, result of our
    computation.

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth rate.

    The most important ones are the exponential and the gamma function, which practically means that every program working with anything else than polynomials will be flawed.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly.

    This is because if we do not know a priori the size of the numbers, we cannot tell if their product will fit in the representation. That is, we would have to check manually for precision underflow before each multiplication.

2 Improve phrasing and consistance
source | link

You seem to do an implicit statement, according to which once Iwe know the scale of myour problem I, we can use fixed pointfixed point arithmetic with respect to this scale to solve mythat problem.

Sometimes, this is a valid approach, and this is the one choosedpicked by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are either integers or distances occuring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—much smaller than what the human eye can perceive—and to convert all quantities into multiples of this unit. A very important remark, is that in the typograhical problems relying on this representation of numbers, we never need to multiply two lengthes together, so that loss of precision caused my multiplications in fixed point arithmetic do not occur.

Most of the times, it is however a terrible approach, here are thea few reasons why:

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding an appropriatea system to system isappropriately represent all constants you need might not even be possible (think. Think to quantum physicits working with the lightspeed fast infinitely small particles) whose speed is near the speed of light.

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In yourthe solar system setting, you described, we can represent Pi with 6 decimal places, which givegives a terrible accuracy when computing the circumference of ana planet orbit, for instance.

  3. In a fixed point system, youwe need to know in advance the size of the quantity you are computing.

    Say youAssume that we still do not know the value of the gravitational constant. YouWe would make a lot of measures and write a computer program to find an approximation of that constant. Unfortunately, plug everything in the computer and… tada!solar system setting you described, the gravitational constant is represented by 0, which should be the, rather useless, result of our
    You get a zero!computation.

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth rate. Basically

    The most important ones are the exponential and the the gamma function, for the most important oneswhich practically means that every program working with anything else than polynomials will be flawed.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly,.

    This is because if youwe do not know a priori the size of the numbers, you we cannot tell if if their product will fit in the representation. That is representable or not—leading, we would have to check large numerical errorsmanually for precision underflow before each multiplication.

While yourthe conclusion implyof your question implies that fixed point arithmetic could be sufficient for all-purpose computations and that floating point arithmetic should be reserved to supercalculators, it is precisely the converse thatwhich is true: floating point arithmetic is a very good and very sensible tool for all-purpose computations, while fixed point will only do well in very specific, well analysed, cases.

You seem to do an implicit statement, according to which once I know the scale of my problem I can use fixed point arithmetic with respect to this scale to solve my problem.

Sometimes, this is a valid approach, and this is the one choosed by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are integers or distances occuring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—much smaller than what the human eye can perceive—and convert all quantities into multiples of this unit. A very important remark, is that in the typograhical problems relying on this representation of numbers, we never need to multiply two lengthes together.

Most of the times, it is however a terrible approach, here are the reasons why:

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding an appropriate system is not even possible (think to quantum physicits working with the lightspeed fast infinitely small particles).

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In your solar system setting, you can represent Pi with 6 decimal places, which give a terrible accuracy when computing the circumference of an orbit, for instance.

  3. In a fixed point system, you need to know in advance the size of the quantity you are computing.

    Say you do not know the value of the gravitational constant. You make a lot of measures, plug everything in the computer and… tada! You get a zero!

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth. Basically the exponential and the gamma function, for the most important ones.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly, because if you do not know the size of the numbers, you cannot tell if their product is representable or not—leading to large numerical errors.

While your conclusion imply that fixed point arithmetic could be sufficient for all-purpose computations and that floating point arithmetic should be reserved to supercalculators, it is precisely the converse that is true: floating point arithmetic is a very good and very sensible tool for all-purpose computations, while fixed point will only do well in very specific, well analysed, cases.

You seem to do an implicit statement, according to which once we know the scale of our problem, we can use fixed point arithmetic with respect to this scale to solve that problem.

Sometimes, this is a valid approach, and this is the one picked by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are either integers or distances occuring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—much smaller than what the human eye can perceive—and to convert all quantities into multiples of this unit. A very important remark, is that in the typograhical problems relying on this representation of numbers, we never need to multiply two lengthes together, so that loss of precision caused my multiplications in fixed point arithmetic do not occur.

Most of the times, it is however a terrible approach, here are a few reasons why:

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding a system to appropriately represent all constants you need might not even be possible. Think to quantum physicits working with infinitely small particles whose speed is near the speed of light.

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In the solar system setting you described, we can represent Pi with 6 decimal places, which gives a terrible accuracy when computing the circumference of a planet orbit, for instance.

  3. In a fixed point system, we need to know in advance the size of the quantity you are computing.

    Assume that we still do not know the value of the gravitational constant. We would make a lot of measures and write a computer program to find an approximation of that constant. Unfortunately, in the solar system setting you described, the gravitational constant is represented by 0, which should be the, rather useless, result of our
    computation.

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth rate.

    The most important ones are the exponential and the gamma function, which practically means that every program working with anything else than polynomials will be flawed.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly.

    This is because if we do not know a priori the size of the numbers, we cannot tell if their product will fit in the representation. That is, we would have to check manually for precision underflow before each multiplication.

While the conclusion of your question implies that fixed point arithmetic could be sufficient for all-purpose computations and that floating point arithmetic should be reserved to supercalculators, it is precisely the converse which is true: floating point arithmetic is a very good and very sensible tool for all-purpose computations, while fixed point will only do well in very specific, well analysed, cases.

1
source | link