Post:Lumium-alloy tongs - 06/11/2011 - 00:51

From Elanthipedia
Jump to navigation Jump to search
Re: Lumium-alloy tongs · on 06/11/2011 12:51 AM CDT 1312
Trying to do float-point math with integers unfortunately can result in oddness such as this.

In this case you should have 66.666... % lumium, and 16.666... % of the others. The system only tracks volumes, so the %s end up displaying truncated when calculated, and don't always add up to 100%.

When you cut the thing into a 10 volume and a 2 volume piece, the 8 volume of lumium becomes 8 * 2 / 12 = 1.333... volume, and the others become 2 * 2 / 12 = .333...

The problem here is we must ensure the volume adds up to a whole number. (1.33 + .33 + .33) does not, so we increase the first metal in the list to 1.34. Then 1.34 / 2 = 67%.

If it looks like this is causing people a lot of headaches, I do know of a design strategy that would eliminate it. But, with an estimated 5 weeks to implement I'm going to hold off a bit before jumping on it.

This message was originally posted in Lore \ Smithing Skill, by DR-KODIUS on the play.net forums.