PDA

View Full Version : Rounding error?



FOUNDATION
Jan 9th, '04, 05:02 AM
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.

Simon
Jan 9th, '04, 05:05 AM
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

FOUNDATION
Jan 9th, '04, 02:53 PM
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.

Simon
Jan 9th, '04, 02:58 PM
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.

Simon
Jan 9th, '04, 03:47 PM
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.

FOUNDATION
Jan 9th, '04, 04:33 PM
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).

Simon
Jan 9th, '04, 04:57 PM
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).