vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.16k stars 138 forks source link

Corrupted characters in printing f(-2147483648) #139

Closed tueda closed 7 years ago

tueda commented 8 years ago
CF f;
L G8 = f(-2147483648);
P;
.end

prints

   G8 =
      f(-./,),(-*,();

More details:

CF f;
L F6 = f(+2147483646);
L F7 = f(+2147483647);
L F8 = f(+2147483648);
L F9 = f(+2147483649);
L F0 = f(+2147483650);
L G6 = f(-2147483646);
L G7 = f(-2147483647);
L G8 = f(-2147483648);
L G9 = f(-2147483649);
L G0 = f(-2147483650);
P "%t [%r]";
.end
FORM 4.1 (Nov  3 2016, v4.1-20131025-256-g6b38064) 64-bits  Run: Mon Nov  7 20:20:50 2016
 + f(2147483646) [9  150  5  0  -16  2147483646  1  1  3  ]
 + f(2147483647) [9  150  5  0  -16  2147483647  1  1  3  ]
 + f(2147483648) [13  150  9  0  6  0  4  -./,),(-*,(  1  3  1  1  3  ]
 + f(2147483649) [13  150  9  0  6  0  4  -2147483647  1  3  1  1  3  ]
 + f(2147483650) [13  150  9  0  6  0  4  -2147483646  1  3  1  1  3  ]
 + f(-2147483646) [9  150  5  0  -16  -2147483646  1  1  3  ]
 + f(-2147483647) [9  150  5  0  -16  -2147483647  1  1  3  ]
 + f(-./,),(-*,() [9  150  5  0  -16  -./,),(-*,(  1  1  3  ]
 + f( - 2147483649) [13  150  9  0  6  0  4  -2147483647  1  -3  1  1  3  ]
 + f( - 2147483650) [13  150  9  0  6  0  4  -2147483646  1  -3  1  1  3  ]

It seems to be just a bug in the printing. The fast notation is correctly used.

Note that 32-bit signed numbers are from -2,147,483,648 to 2,147,483,647 on my machine. (Off course, the range is system-dependent; the C standard says anything about the format, signed magnitude, one's/two's complement or others.)