u/qx9 - 3 Archived Voat Posts in v/programming
u/qx9
  • home
  • search

u/qx9

0 posts · 3 comments · 3 total

Active in: v/programming (3)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: [Humor] How to save the princess using 8 programming languages

Rescuing the princess is impossible, since both the princess and castle are immutable.

Instead, you make a new princess that is free but otherwise identical.

3 06 Oct 2016 18:25 u/qx9 in v/programming
Comment on: Concerning type float, if I typed out 38 digits, put a decimal point anywhere on that number except for the ends, and chose my 7 significant digits, can I really deal with those significant digits?

That's not a good example because multiplying by a power of two just bumps the exponent and doesn't change the mantissa, so no accuracy is lost unless it overflows. The expressions 4.59 * 8 and 4.59 * 2.0 * 2.0 * 2.0 will always be equal. A better example would be 4.59 * 1.331 which is more accurate than 4.59 * 1.1 * 1.1 * 1.1.

2 30 Jan 2016 19:20 u/qx9 in v/programming
Comment on: Concerning type float, if I typed out 38 digits, put a decimal point anywhere on that number except for the ends, and chose my 7 significant digits, can I really deal with those significant digits?

@mort is right. Some numbers can be represented with perfect accuracy, and if the result is such a number then you don't lose accuracy. For example, 0.125 * 8 always equals 1 because 0.125, 8 and the result can all be represented perfectly as floats. That is the exception though, in most cases accuracy is lost.

1 30 Jan 2016 19:14 u/qx9 in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.