Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP Math error

Using SRP Math to add numbers, and it is truncating trailing zeros.
See example, value in PART_TOTAL was 600000000, which resulted in a value of 6.
I changed in the code to 600010000 to test, and the result was 60001

I downloaded the latest 2.01 version just to check and this was the same.
A bit worried now, will have to revert to the normal OI math.


Comments

  • Thanks Kevin, works OK.
    Was that RC6 already available, or was this a new issue?
    Also, do you have any test scripts that you run on the maths functions, as its pretty critical that we have confidence.
  • This was a new issue. I do have a suite of unit tests that I run, but they were passing. It's difficult to get total coverage with a Math utility given the infinite permutations. I can assure you that the issue had nothing to do with the arithmetic itself. The problem was that the third party library sometimes appends extra zeroes when converting to a string, and I was trying to undo that artifact... but my code was overzealous.
  • OK cool, thanks
    It works so I am happy to release.
  • Don't they say zealousy's a curse?

Sign In or Register to comment.