postmodern,

@0xabad1dea there are some reasons why you'd want to keep a value a float, except only one seems to make sense in this context.

  1. Premature Optimizations. It takes extra cycles to convert floats or doubles back to integers and round them up or down. However this begs the question why didn't they simple do integer division and keep the number as an integer?
  2. Preserving accuracy. If you have an equation that already involves floats, and outputs a float, and the float value is used later on in other calculations, it might make sense to keep it a float to preserve any fractional bits that might have gotten into the number. One real-world example of this is keeping pixel color values or PCM values as floats or doubles after manipulating them, instead of converting them back to integers in order to preserve accuracy and avoid premature rounding. Although, if they wanted to preserve accuracy, why not use a double?
  3. Academic programmer.
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • magazineikmin
  • ethstaker
  • InstantRegret
  • tacticalgear
  • rosin
  • love
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • cubers
  • thenastyranch
  • mdbf
  • provamag3
  • modclub
  • GTA5RPClips
  • normalnudes
  • khanakhh
  • everett
  • cisconetworking
  • osvaldo12
  • anitta
  • Leos
  • Durango
  • tester
  • megavids
  • JUstTest
  • All magazines