Skip to main content
Tweeted twitter.com/#!/StackProgrammer/status/85458800609460224
added question mark so there would be a real question
Source Link

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at Jon Skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then I remember I learned 6502 very early and never needed floats in most of my programs. The only time I used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double.? So I know to watch out for these gotchas. With money I use longs and store values by the cent, for speed of an object in a game I add ints and divide (or bitshift) the value to know if I need to move a pixel or not. (I made object move in the 6502 days, we had no divide nor floats but had shifts).

So I was mostly curious.

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at Jon Skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then I remember I learned 6502 very early and never needed floats in most of my programs. The only time I used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double. So I know to watch out for these gotchas. With money I use longs and store values by the cent, for speed of an object in a game I add ints and divide (or bitshift) the value to know if I need to move a pixel or not. (I made object move in the 6502 days, we had no divide nor floats but had shifts).

So I was mostly curious.

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at Jon Skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then I remember I learned 6502 very early and never needed floats in most of my programs. The only time I used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double? So I know to watch out for these gotchas. With money I use longs and store values by the cent, for speed of an object in a game I add ints and divide (or bitshift) the value to know if I need to move a pixel or not. (I made object move in the 6502 days, we had no divide nor floats but had shifts).

So I was mostly curious.

corrected spelling
Source Link
ChrisF
  • 38.9k
  • 11
  • 127
  • 168

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at john skeetJon Skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then iI remember iI learned 6502 very early and never needed floats in most of my programs. The only time iI used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double. So iI know to watch out for these gotchas. With money iI use longs and store values by the cent, for speed of an object in a game iI add ints and divide (or bitshift) the value to know if iI need to move a pixel or not. (I made object move in the 6502 days, we had no dividdivide nor floats but had shifts).

So iI was mostly curious.

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at john skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then i remember i learned 6502 very early and never needed floats in most of my programs. The only time i used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double. So i know to watch out for these gotchas. With money i use longs and store values by the cent, for speed of an object in a game i add ints and divide (or bitshift) the value to know if i need to move a pixel or not. (I made object move in the 6502 days, we had no divid nor floats but had shifts).

So i was mostly curious.

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at Jon Skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then I remember I learned 6502 very early and never needed floats in most of my programs. The only time I used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double. So I know to watch out for these gotchas. With money I use longs and store values by the cent, for speed of an object in a game I add ints and divide (or bitshift) the value to know if I need to move a pixel or not. (I made object move in the 6502 days, we had no divide nor floats but had shifts).

So I was mostly curious.

Source Link
user2528
user2528

Why do you need float/double?

I was watching http://www.joelonsoftware.com/items/2011/06/27.html and laughed at john skeet joke about 0.3 not being 0.3. I personally never had problems with floats/decimals/doubles but then i remember i learned 6502 very early and never needed floats in most of my programs. The only time i used it was for graphics and math where inaccurate numbers were ok and the output was for the screen and not to be stored (in a db, file) or dependent on.

My question is, where are places were you typically use floats/decimals/double. So i know to watch out for these gotchas. With money i use longs and store values by the cent, for speed of an object in a game i add ints and divide (or bitshift) the value to know if i need to move a pixel or not. (I made object move in the 6502 days, we had no divid nor floats but had shifts).

So i was mostly curious.