Closed Thread
Results 1 to 7 of 7

Thread: Rounding error?

  1. #1
    Join Date
    Feb 2003
    Location
    SF Bay Area
    Posts
    44
    Rep Power
    0

    Rounding error?

    I'm running HD 2.11.

    I'm not sure if there is a preference setting that I'm missing or if I'm misunderstanding the rules or if there is a bug.

    I'm finding that the real costs of powers with fractional values are being rounded down when the power's fractional value is .5 and above.

    I've narrowed the cutoff point to somewhere between .608695652 (which rounds down) and .666666667 which rounds up. I'm under the impression that fractional values of .5 and above should round up while everything below .5 should round down (interpolating from the second power example on page 180 of the fifth ed. rule book).

    I tried setting the "Number of decimal places for rounding" (in file->preferences) to 1, 2 and 5 - but the result was always the same.

    Some of the example powers (I tried others) I used were...
    3d6 EB
    extra time -1 1/2
    1 charge -4
    incantations -1/4

    This has an active cost of 15 and a fractional real cost of 2.608695652 - which HD rounds to 2

    The above power was just an attempt on my part to try and narrow down where the actual cutoff point was.

    Powers that have a fractional cost of 2/3 or higher seem to (correctly) round up. Presumably, the cutoff point is somewhere between the two.

    Is this an issue of my needing to set the correct preferences or is this a bug?

    My apologies if someone else has already asked this question.

  2. #2
    Join Date
    Feb 2003
    Location
    Chicago
    Age
    38
    Posts
    9,787
    Blog Entries
    10
    Rep Power
    44927
    A 3d6 EB has an Active Cost of 15, correct, but your math is off on the Real Cost.

    15/(1+.25+1.5+4) = 15/6.75 = 2.2222222 = 2
    White Hats are for CISSPs

  3. #3
    Join Date
    Feb 2003
    Location
    SF Bay Area
    Posts
    44
    Rep Power
    0

    Rounding error followup



    You're right about my math being off in the first post (a few below this one and titled "Rounding error?"). That's what I get for writing it when I was so tired.

    A much simpler example is...

    3D6 EB
    OAF (-1)

    (15 / 2 = 7.5)

    This should produce a fractional cost of 7.5 - which should round to 8, but HD reports it as 7.

    A bit more involved is...

    2" Tunneling
    +2 Def (6 pt adder)
    Focus (-2)
    Limited Power (-1 1/2)
    Charges (-4)
    Independent (-2)

    (10+6)/(1+2+1.5+4+2) = 1.523809524

    This should presumably round to 2, but HD rounds it to 1.

    I had another power that ended up with a real cost of 2.564102564 - which rounded to 2 until I set the number of decimal places for rounding from 1 to 5. HD then correctly rounded that real cost up to 3. Unfortunately, HD still did not seem to round the above two examples correctly.

  4. #4
    Join Date
    Feb 2003
    Location
    Chicago
    Age
    38
    Posts
    9,787
    Blog Entries
    10
    Rep Power
    44927
    In both cases, HD is correct.

    1.5 rounds in the players' favor to 1

    1.52 (assuming 2 decimal places of accuracy) rounds to 1.5 which rounds in the player's favor to 1.
    White Hats are for CISSPs

  5. #5
    Join Date
    Feb 2003
    Location
    Chicago
    Age
    38
    Posts
    9,787
    Blog Entries
    10
    Rep Power
    44927
    The Hero System does some odd things with rounding.

    First off, you have the concept that .5 rounds in the player's favor. Which means sometimes it rounds up, sometimes it rounds down. Normally down.

    Secondly, the way you get to ".5" is a bit odd. Let's say, for the sake of example, that you're dealing with 3 decimal places of precision. If you have a number like:

    1.5469899999

    It rounds as such:

    Step 1: Crop the number to 3 decimal places. Do not round, just ignore everything after the 3rd decimal place. This gives you 1.546

    Step 2: Round to 2 decimal places, .5 rounds in the player's favor (we'll assume down). This gives you 1.55

    Step 3: Round to 1 decimal place, .5 rounds in the player's favor (we'll assume down). This gives you 1.5

    Step 4: Round to an integer, .5 rounds in the player's favor (we'll assume down). This gives you 1

    This is the way the Hero System rounding rules are setup and this is the way that HD works.
    White Hats are for CISSPs

  6. #6
    Join Date
    Feb 2003
    Location
    SF Bay Area
    Posts
    44
    Rep Power
    0
    Thanks for the clarification on that!

    One last question about rounding that is still confusing me.

    The following example illustrates it...

    The nomenclature I'm using for power costs is "active/real" for the framework and "active/active after framework discount/real" for the slot in the framework.

    15/12 EC Flight powers, IIF (-1/4)
    30/15/8 15" Flight, IIF (from the framework) (-1/4), double turn mode (-1/2)

    My question deals with the real cost of the flight. No matter what I set the rounding preference to, HD reports the real cost as 8. When I use a calculator though...

    (30 - 15) / 1.75 = 8.571428571 - which, using the process you described above, should presumably round to 9 if the rounding preference is set to two digits or higher (I tried 1, 2 and 5 and always got the same result).
    Last edited by FOUNDATION; Jan 9th, '04 at 04:35 PM.

  7. #7
    Join Date
    Feb 2003
    Location
    Chicago
    Age
    38
    Posts
    9,787
    Blog Entries
    10
    Rep Power
    44927
    OK....finally we get down to an actual bug.

    I've got the issue fixed in HD.....the rounding for that type of number will be corrected in the next update. For the time being, HD is treating everything like 1 decimal place of precision (which is what the book recommends).
    White Hats are for CISSPs

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Error Loading/Previewing characters
    By Talon in forum HERO Designer Discussion
    Replies: 3
    Last Post: May 9th, '03, 07:25 AM
  2. TINY factual error in Millenium City book.
    By Allensh in forum Champions
    Replies: 15
    Last Post: Apr 23rd, '03, 05:53 PM
  3. Fatal Application Error ? Help!
    By Amnesia in forum HERO Designer Discussion
    Replies: 7
    Last Post: Feb 24th, '03, 06:21 AM
  4. Standard Rounding
    By Ben Seeman in forum HERO System 6th Edition Rules Questions
    Replies: 1
    Last Post: Feb 21st, '03, 07:25 PM
  5. Error opening 1.18
    By Norseman in forum HERO Designer Discussion
    Replies: 4
    Last Post: Feb 14th, '03, 01:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts