Ошибочная обработка диапазона
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cc2regex |
Fix Committed
|
High
|
Alexander Rudenko |
Bug Description
Диапазоны, в которых первое число начинается с 0, обрабатываются неправильно при создании списка.
Недоработка есть и в функции создания списка, и в regexcreate.
Пример 1.1:
./createqueue.php 01 10
...
(
[0] => 01
[1] => 9
[2] => 10
[3] => 10
)
...
ERROR, BAD NUMBERS: 01 9
Пример 1.2:
./regexcreator.php 01 10
...
ERROR, BAD NUMBERS: 1 10
Пример 2.1:
./createqueue.php 011 112
...
(
[0] => 011
[1] => 11
[2] => 12
[3] => 19
[4] => 20
[5] => 99
[6] => 100
[7] => 109
[8] => 110
[9] => 112
)
Пример 2.2:
./regexcreator.php 011 111
Minumum: 11 Maximum: 111
Minumum: integer Maximum: integer
ERROR, BAD NUMBERS: 11 111
Related branches
Changed in cc2regex: | |
assignee: | nobody → Alexander Rudenko (rudenko) |
Варианты:
1. перед обработкой чисел, начинающихся с 0, отрезать слева нули, потом прибававлять к полученным.
+ обнаружен замкнутый цикл при обработке числа 0 (00, 000).
+ возможно, стоит отказаться от gmp.