[petsc-users] Operand '<' error

Smith, Barry F. bsmith at mcs.anl.gov
Sun Jan 13 17:11:04 CST 2019


   complex numbers cannot be larger than other complex numbers or smaller. If you want to compare the real parts you can use

     PetscRealPart(a) < PetscRealPart(b)

   similarly for imaginary parts

   Barry
> On Jan 13, 2019, at 5:06 PM, Choudhary, Devyani D via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hi,
> 
> I am trying to compare two PetscScalar values, but am getting this error:
> 
> error: no operator "<" matches these operands
> operand types are: PetscScalar < PetscScalar
> 
> Please do share if you know how to resolve this error.
> 
> Sincerely,
> Devyani



More information about the petsc-users mailing list