
# Legend:

### file.cc
## function decl
# Clang sanitizer output
% Octave output
%% Comments added by me (PK)

####################

### xpow.cc

## octave_value xpow (const Matrix& a, double b)

[1 2; 3 4] ^ (-2^31)
#../../libinterp/corefcn/xpow.cc:216:26: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
#../../libinterp/corefcn/xpow.cc:233:19: runtime error: signed integer overflow: -2147483648 + -1 cannot be represented in type 'int'
%ans =
%   Inf  -Inf
%  -Inf   Inf

[1 2; 3 4] ^ (2^31)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:201: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi


## octave_value xpow (const PermMatrix& a, double b)

p = eye(3)(:, [1 3 2]);
p ^ (2^32)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:310: runtime error: value 4.29497e+09 is outside the range of representable values of type 'int'
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:201: runtime error: value 4.29497e+09 is outside the range of representable values of type 'int'
%ans =
%   1.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i
%   0.00000 + 0.00000i   1.00000 - 0.00000i   0.00000 + 0.00000i
%   0.00000 + 0.00000i   0.00000 + 0.00000i   1.00000 - 0.00000i


## octave_value xpow (const ComplexMatrix& a, double b)

[1i 1i; 1i 1i] ^ (2^31)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:465: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi

[1i 1i; 1i 1i] ^ (-2^31)
#../../libinterp/corefcn/xpow.cc:480:26: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
#../../libinterp/corefcn/xpow.cc:497:19: runtime error: signed integer overflow: -2147483648 + -1 cannot be represented in type 'int'
%warning: inverse: matrix singular to machine precision, rcond = 0
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi


## octave_value xpow (const FloatMatrix& a, float b)
single([1 1; 1 1]) ^ (2^31)
%/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:1647: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi

## octave_value xpow (const FloatComplexMatrix& a, float b)

single([1i 1; 1 1]) ^ (2^31)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:1900: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi


## octave_value elem_xpow (const FloatNDArray& a, const FloatNDArray& b)

a = -single([1,2;3,4]); b=single([1 1; 1 2^32]); a.^b
%% NOTE: Why is the
%%  (const FloatNDArray& a, const FloatNDArray& b)
%% overload called and not
%%  (const FloatMatrix& a, const FloatMatrix& b)
%% ?
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:2621: runtime error: value 4.29497e+09 is outside the range of representable values of type 'int'
%ans =
%  -1.0000 - 0.0000i  -2.0000 - 0.0000i
%  -3.0000 - 0.0000i      Inf -    Infi


### sparse-xpow.cc

## octave_value xpow (const SparseMatrix& a, double b)

sparse([1 1; 1 1]) ^ (2^31)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/operators/op-sm-s.cc:66: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:201: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi

%% AFTER CLEANUP: errors 'error: use full(a) ^ full(b)'
try
sparse([1 1; 1 1]) ^ (-2^31)
end
#../../libinterp/corefcn/sparse-xpow.cc:91:26: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
%error: UMFPACK not installed


## octave_value xpow (const SparseComplexMatrix& a, double b)

sparse([1i 1; 1 1]) ^ (2^31)
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/operators/op-scm-s.cc:72: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
#/home/pk/dl/octave-default/build/libinterp/../../libinterp/corefcn/xpow.cc:465: runtime error: value 2.14748e+09 is outside the range of representable values of type 'int'
%ans =
%   NaN - NaNi   NaN - NaNi
%   NaN - NaNi   NaN - NaNi

%% AFTER CLEANUP: errors 'error: use full(a) ^ full(b)'
try
sparse([1i 1; 1 1]) ^ (-2^31)
end
#../../libinterp/corefcn/sparse-xpow.cc:164:26: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
%error: UMFPACK not installed


### NEW RESULTS:

%{
%% CHANGED
ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   1.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i
   0.00000 + 0.00000i   1.00000 - 0.00000i   0.00000 + 0.00000i
   0.00000 + 0.00000i   0.00000 + 0.00000i   1.00000 - 0.00000i

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

  -1.0000 - 0.0000i  -2.0000 - 0.0000i
  -3.0000 - 0.0000i      Inf -    Infi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi

ans =

   NaN - NaNi   NaN - NaNi
   NaN - NaNi   NaN - NaNi
%}
