What's the term I'm looking for

airbornflghtairbornflght Houston, TX Icrontian
edited March 2007 in Internet & Media
Ok, I usually know this but I am having a major brain fart or something because it has escaped me.

ok, if I wanted to take a double value x, say is 12.3425545 and I want to output it out to the 2nd decimal place. I know that I can either do output formating, but can't I also just reassign it all cut off like 12.34 so that is all there is.

What is that called?

Comments

  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited March 2007
    truncating?
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited March 2007
    either that or quantizing.

    I'd say leave it as 12.34532459233253 in memory and just format the output. If you do later calculations with the number, it'll be more accurate if you just leave as much precision in memory as possible.
  • airbornflghtairbornflght Houston, TX Icrontian
    edited March 2007
    I did formatting, but yes, truncating is what I was looking for. It was just driving me crazy because I couldn't think of the word.

    I am modding the AP CS MBCS a lot. Well, my class is only at chapter 3 and I am just doing everything to it that I think it needs. I'm working on making the fish's offspring mutate randomly. A lot of what I've added is debugging information.
  • nonstop301nonstop301 51° 27' 24.87" N // 0° 11' 38.91" W Member
    edited March 2007
    "round it up" is the layman's term :)
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited March 2007
    rounding up tends to mean to the next highest integer.
  • nonstop301nonstop301 51° 27' 24.87" N // 0° 11' 38.91" W Member
    edited March 2007
    I was thinking in terms of "rounding up to two decimal places" :)
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited March 2007
    bah. quantization sounds way cooler.
  • csimoncsimon Acadiana Icrontian
    edited March 2007
    ah yes "rounding down" is what came to mind first.
Sign In or Register to comment.