Explorar o código

* check -1**4 for both vars and constants

pierre %!s(int64=23) %!d(string=hai) anos
pai
achega
abbb7ed41c
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      tests/webtbs/tw0869.pp

+ 6 - 1
tests/webtbs/tw0869.pp

@@ -1,7 +1,7 @@
 program prueba;
 uses crt;
 var
- resultado,exponente:integer;
+ i,resultado,exponente:integer;
 begin
  exponente := 3;
  resultado := -1 ** exponente;
@@ -17,6 +17,11 @@ begin
  writeln (resultado);
  if resultado<>1 then
    Halt(1);
+ i:=1;
+ resultado := - i ** exponente;
+ writeln (resultado);
+ if resultado<>-1 then
+   Halt(1);
  resultado := -1 ** exponente;
  writeln (resultado);
  if resultado<>-1 then