PDA

View Full Version : Numberfields with more than 7 or 8 digits



Sorcerer
April 13th, 2011, 18:21
I'm not sure if this is a known issue or not, but I noted some strange behavior with standard numberfields today.

if you type into a numberfield (lets say the XP field in the 4E ruleset, but it seems not to be ruleset specific)

9999999

no problem

if you try to type in an eighth "9" then instead of the expected

99999999

you get

10000000


this is not just limited to 9's other weird stuff happens with other digits as well.

for example type in 8 "7"'s and you get 7777776

anyway not sure if anyone really needs such large numbers - but I just wanted to give you all a heads up.

in case this is a new phenomenon, I should add this is using FG 2.7.5

Zeus
April 13th, 2011, 19:13
Yep I concur, it happens under 2.7.5 and 2.7.4 for me under 4E. Looks like a bug.

If I recall correctly JPG tweaked number based controls in a previous FGII release after integer notation would change to abbreviated scientific form e.g 10E +2 for high values, maybe its a side effect of the tweaks made.

StuartW
April 13th, 2011, 20:29
I don't think it's a bug: I think it is a 'feature' of the floating point precision. I believe FG uses floating point for numbers (which is why it can support decimal places, not just whole numbers, and is also probably why it defaulted to scientific form), but the downside is the limit in accuracy.

I'm sure JPG will correct me or give a more complete explanation!

Stuart

Zeus
April 13th, 2011, 20:47
StuartW, I think your probably right but I do recall tweaks having been made to get rid of the scientific form notation for high values. Then again I could be wrong (wouldn't be the first time). JPG - put me out of my misery please.

Moon Wizard
April 13th, 2011, 22:36
It's not a bug. It's a limitation of the numeric implementation inside FG. The LUA engine is built using floating point values for numbers.

Whilst I believe the engine can be recompiled to use double float values, I would also have to change all interfaces within FG as well as the numeric code objects that store the database values. Since it hasn't been an issue (other than display), there are very few uses in RPGs for numbers larger than 7 digits, and the magnitude of work involved in the change; it is low on the priority list.

Cheers,
JPG

Zeus
April 13th, 2011, 23:06
Thank you.

vodokar
April 14th, 2011, 00:01
There is one critical place where there are numbers larger than 6 digits used: XP values in C&C or older versions of D&D.

Moon Wizard
April 14th, 2011, 00:18
Floating point values support 7 significant digits without rounding.
https://en.wikipedia.org/wiki/Floating_point

L26+ magic items in 4E have purchase values in the 7 digit range also. From what I have seen, most games either stop at 7 digits for numeric values or provide alternate units (i.e. currency, etc.).

Cheers,
JPG