[fpc-pascal] StrUtils.RomanToInt oddities

Bart bartjunk64 at gmail.com
Wed Sep 18 16:19:23 CEST 2013


Hi,

RomanToInt acceps rather ludicrous values:

RomanToInt('MDCLXVIVXLDM') = 2209
RomanToInt('IIIIM') = 1002  //calculated as 3 + (1000-1)

Both examples represent invalid roman numbers by any standard.
Also I do not think Roman numerals can be negative...

Feature or bug?

Bart



More information about the fpc-pascal mailing list