diff --git a/lib/algebra.gi b/lib/algebra.gi index e5b2eb64d2..a9d349e211 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -3599,7 +3599,7 @@ InstallMethod( CentralIdempotentsOfAlgebra, g:= GcdRepresentation( p, facs[j] ); gcd:= g[1]*p+g[2]*facs[j]; qq:= g[1]*(cf[j]-c)/gcd; - if qq<>0*qq then + if not IsZero( qq ) then c:= p*EuclideanRemainder( qq, facs[j] ) + c; fi; diff --git a/lib/alglie.gi b/lib/alglie.gi index 419c982adc..8b6e46c8b9 100644 --- a/lib/alglie.gi +++ b/lib/alglie.gi @@ -2964,12 +2964,12 @@ InstallMethod( RootSystem, local s,t,rt; s:=0; t:=0; rt:=a-b; - while (rt in R) or (rt=0*R[1]) do + while (rt in R) or IsZero( rt ) do rt:=rt-b; s:=s+1; od; rt:=a+b; - while (rt in R) or (rt=0*R[1]) do + while (rt in R) or IsZero( rt ) do rt:=rt+b; t:=t+1; od; @@ -4399,7 +4399,7 @@ local ReductionModuloTable, # n:= Length( r ); for i in [1..n-1] do - if r[i][2]=0*r[i][2] or + if IsZero( r[i][2] ) or (Length(r[i][1])>1 and r[i][1][1]=r[i][1][2]) then #the thing is zero; get rid of it. @@ -4413,7 +4413,7 @@ local ReductionModuloTable, # Unbind(r[i]); fi; od; - if r[n][2]=0*r[n][2] or + if IsZero( r[n][2] ) or (Length(r[n][1])>1 and r[n][1][1]=r[n][1][2]) then #the thing is zero; get rid of it. diff --git a/lib/algliess.gi b/lib/algliess.gi index e531184a16..a07932cfa6 100644 --- a/lib/algliess.gi +++ b/lib/algliess.gi @@ -285,7 +285,7 @@ BindGlobal( "SimpleLieAlgebraTypeA_G", function( type, n, F ) # We take care of the commutation relations of the form # [h_j,x_{\beta_i}]= < \beta_i, \alpha_j > x_{\beta_i}. cc:= LinearCombination( R[i], C[j] ); - if cc <> 0*cc then + if not IsZero( cc ) then posR[i][j]:= One(F)*cc; @@ -593,7 +593,7 @@ BindGlobal( "SimpleLieAlgebraTypeA_G", function( type, n, F ) cc:= d*cc; fi; - if cc <> 0*cc then + if not IsZero( cc ) then posR[i][j]:= One(F)*cc; diff --git a/lib/algrep.gi b/lib/algrep.gi index fb08d29bfd..264317833c 100644 --- a/lib/algrep.gi +++ b/lib/algrep.gi @@ -1852,7 +1852,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, is_replaced:= false; for j in [1..Length(cf)] do - if cf[j] <> 0*cf[j] then + if not IsZero( cf[j] ) then if not is_replaced then tt1:= ShallowCopy( tt ); tt1[i]:= bases[i][j]; @@ -1885,7 +1885,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, for i in [1..Length(tensors)] do if len > 0 and tensors[i] = res[len-1] then res[len]:= res[len]+cfts[i]; - if res[len] = 0*res[len] then + if IsZero( res[len] ) then Unbind( res[len-1] ); Unbind( res[len] ); len:= len-2; @@ -2233,7 +2233,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, is_replaced:= false; for j in [1..Length(cf)] do - if cf[j] <> 0*cf[j] then + if not IsZero( cf[j] ) then if not is_replaced then tt1:= ShallowCopy( tt ); tt1[i]:= basis[j]; @@ -2297,7 +2297,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, if len > 0 and tensors[i] = res[len-1] then res[len]:= res[len]+cfts[i]; - if res[len] = 0*res[len] then + if IsZero( res[len] ) then Unbind( res[len-1] ); Unbind( res[len] ); len:= len-2; @@ -2567,7 +2567,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, is_replaced:= false; for j in [1..Length(cf)] do - if cf[j] <> 0*cf[j] then + if not IsZero( cf[j] ) then if not is_replaced then tt1:= ShallowCopy( tt ); tt1[i]:= basis[j]; @@ -2621,7 +2621,7 @@ InstallMethod( ConvertToNormalFormMonomialElement, wed:= tensors[i]; if len > 0 and wed = res[len-1] then res[len]:= res[len]+cfts[i]; - if res[len] = 0*res[len] then + if IsZero( res[len] ) then Unbind( res[len-1] ); Unbind( res[len] ); len:= len-2; @@ -3376,7 +3376,7 @@ InstallHandlingByNiceBasis( "IsDirectSumElementsSpace", rec( cf:= Coefficients( Basis( FamilyObj(v)!.constituentModules[i] ), ev[i] ); for k in [1..Length(cf)] do - if cf[k] <> 0*cf[k] then + if not IsZero( cf[k] ) then Add( vec, num+k ); Add( vec, cf[k] ); fi; diff --git a/lib/autsr.gi b/lib/autsr.gi index 50896eaf96..69b7a44bb8 100644 --- a/lib/autsr.gi +++ b/lib/autsr.gi @@ -1402,7 +1402,7 @@ local D:=List(D,d->List([1..Length(ocr.generators)],i->ocr.generators[i]^-1*d[i])); D:=List(D,d->ocr.listToCocycle(d)); TriangulizeMat(D); - D:=Filtered(D,x->x<>0*x); + D:=Filtered(D,x->not IsZero( x )); b:=BaseSteinitzVectors(b,D).factorspace; diff --git a/lib/ctblgrp.gi b/lib/ctblgrp.gi index ce69dc726c..304b668752 100644 --- a/lib/ctblgrp.gi +++ b/lib/ctblgrp.gi @@ -1006,13 +1006,13 @@ BindGlobal( "SplitTwoSpace", function(D,raum) for root in SquareRoots(D.field,(p/2)^2-q) do a1:=(-p/2+root); n:=v1v2+a1*v2v2; - if (n=0*o) then + if IsZero( n ) then # proceeding would force a division by zero NotFailed:=false; else a2:=-(v1v1+a1*v2v1)/n; n:=v1v1+a2*(v1v2+v2v1)+a2^2*v2v2; - if n<>0*o then + if not IsZero( n ) then deg2:=List(SquareRoots(D.field,o/(raum.dim-d)/n),Int); for d2 in deg2 do if d2 in mdeg2 then diff --git a/lib/fieldfin.gi b/lib/fieldfin.gi index bc1eaad7cc..02097f2c10 100644 --- a/lib/fieldfin.gi +++ b/lib/fieldfin.gi @@ -613,7 +613,7 @@ InstallMethod( NormalBase, [ IsField and IsFinite, IsScalar ], function(F, b) local q, d, z, l, bas, i; - if b=0*b then + if IsZero( b ) then b := One(F); fi; q := Size(LeftActingDomain(F)); diff --git a/lib/grppcaut.gi b/lib/grppcaut.gi index f5fcfeb4d7..c63f557268 100644 --- a/lib/grppcaut.gi +++ b/lib/grppcaut.gi @@ -565,7 +565,7 @@ BindGlobal( "CocycleSQ", function( epi, field ) od; # check - if c = 0 * c then return 0; fi; + if IsZero( c ) then return 0; fi; return c; end ); diff --git a/lib/grppccom.gi b/lib/grppccom.gi index 1aad5dd559..9b4b2e1981 100644 --- a/lib/grppccom.gi +++ b/lib/grppccom.gi @@ -497,7 +497,7 @@ local z,K,N,zett,SN,B,L,tau,gens,imgs,A,T,heads,dim,s,v,j,i,root; od; while j <= dim and heads[j] <> 0 do z:=v[j] / B[heads[j]][j]; - if z <> 0*z then + if not IsZero( z ) then s:=s / A[heads[j]] ^ ocr.logTable[LogFFE(z,root)+1]; fi; v:=v - v[j] / B[heads[j]][j] * B[heads[j]]; diff --git a/lib/lierep.gi b/lib/lierep.gi index 498cade4ea..9f33adb838 100644 --- a/lib/lierep.gi +++ b/lib/lierep.gi @@ -199,7 +199,7 @@ InstallMethod( \+, i:= i+1; fi; od; - list:= Filtered( list, x -> x[2]<>0*x[2] ); + list:= Filtered( list, x -> not IsZero( x[2] ) ); l[k]:= list; fi; od; @@ -433,7 +433,7 @@ InstallHandlingByNiceBasis( "IsCochainsSpace", rec( while j <> Length( vec ) do l[k]:= [ ]; for i in [j+1..j+Length(tt)] do - if vec[i] <> 0*vec[i] then + if not IsZero( vec[i] ) then Add( l[k], [ tt[i-j], vec[i] ] ); fi; od; @@ -494,7 +494,7 @@ InstallGlobalFunction( ValueCochain, cfs1:= [ ]; for i in [1..Length(cfs)] do for j in [1..Length(cfs[i][k])] do - if cfs[i][k][j] <> 0*cfs[i][k][j] then + if not IsZero( cfs[i][k][j] ) then cf:= ShallowCopy( cfs[i] ); cf[k] := [ cf[k][j], j ]; Add( cfs1, cf ); @@ -603,7 +603,7 @@ InstallGlobalFunction( LieCoboundaryOperator, cfs:= Coefficients( Basis(V), val ); for k in [1..Length(cfs)] do - if cfs[k] <> 0*cfs[k] then + if not IsZero( cfs[k] ) then Add( list[k], [ t, cfs[k] ] ); fi; od; @@ -873,7 +873,7 @@ BindGlobal( "NextIterator_WeylOrbit", function( it ) if it!.status = 1 then it!.status:= 2; mu:= it!.currentWeight; - if mu = 0*mu then + if IsZero( mu ) then it!.isDone:= true; fi; return mu; @@ -1642,7 +1642,7 @@ InstallGlobalFunction( CollectUEALatticeElement, od; Append( res, WriteAsLCOfBinoms( vars, q ) ); for k in [2,4..Length(res)] do - if res[k] = 0*res[k] then + if IsZero( res[k] ) then Unbind( res[k-1] ); Unbind( res[k] ); fi; od; @@ -2194,7 +2194,7 @@ InstallMethod( \*, for i in [1..Length( mons )] do if len > 0 and lst[len-1] = mons[i] then lst[len]:= lst[len]+cfs[i]; - if lst[len] = 0*lst[len] then + if IsZero( lst[len] ) then Remove( lst, len-1 ); Remove( lst, len-1 ); len:= len-2; @@ -2673,7 +2673,7 @@ InstallGlobalFunction( LeftReduceUEALatticeElement, rem:= p; res:= 0*p; - while rem <> 0*rem do + while not IsZero( rem ) do m1:= LeadingUEALatticeMonomial( novar, rem ); k:= 1; @@ -2806,7 +2806,7 @@ InstallMethod(\+, lu:= lu0; else cf:= lu[2*p]+lv[k+1]; - if cf = 0*cf then + if IsZero( cf ) then Remove( lu, 2*p-1 ); Remove( lu, 2*p-1 ); Remove( vecs, p ); @@ -2980,14 +2980,14 @@ InstallOtherMethod(\^, for k in [j,j+2..len] do cf:= cf*Binomial( hw[ em[i][k]-2*n ], em[i][k+1] ); od; - if cf <> 0*cf then + if not IsZero( cf ) then mon:= em[i]{[1..j-1]}; pos:= Position( er, mon ); if pos = fail then Add( er, mon ); Add( er, cf ); else er[pos+1]:= er[pos+1]+cf; - if er[pos+1] = 0*er[pos+1] then + if IsZero( er[pos+1] ) then Remove( er, pos ); Remove( er, pos ); fi; @@ -3002,7 +3002,7 @@ InstallOtherMethod(\^, Add( er, mon ); Add( er, cf ); else er[pos+1]:= er[pos+1]+cf; - if er[pos+1] = 0*er[pos+1] then + if IsZero( er[pos+1] ) then Remove( er, pos ); Remove( er, pos ); fi; @@ -3296,7 +3296,7 @@ InstallMethod( HighestWeightModule, # divide by their greatest common divisor. res:= LeftReduceUEALatticeElement( novar, G, lms, lmtab, p ); - if res <> 0*res then + if not IsZero( res ) then cf:= res![1]{[2,4..Length(res![1])]}; res:= (Lcm(List(cf,DenominatorRat))/ Gcd(List(cf,NumeratorRat)))*res; @@ -3640,7 +3640,7 @@ InstallMethod( HighestWeightModule, LeadingUEALatticeMonomial(novar,fac1)[3]*fac2; comp:= NormalizedLeftReduction( novar, GB, lms, lmtab, comp ); - if comp <> 0*comp then + if not IsZero( comp ) then vec:= ListWithIdenticalEntries( Length( sortmn[pp] ), 0 ); @@ -3684,7 +3684,7 @@ InstallMethod( HighestWeightModule, ecomp:= [ ]; cfsc:= [ ]; for i in [1..Length(vecs[l])] do - if vecs[l][i] <> 0*vecs[l][i] then + if not IsZero( vecs[l][i] ) then Add( ecomp, sortmn[j][i] ); Add( cfsc, vecs[l][i] ); @@ -3995,7 +3995,7 @@ InstallGlobalFunction( ExtendRepresentation, for s in [1..Length(cij[1])] do M:= M - cij[2][s]*mm[cij[1][s]]; od; - if M <> 0*M then return false; fi; + if not IsZero( M ) then return false; fi; od; od; return true; diff --git a/lib/matrix.gi b/lib/matrix.gi index 53da3e2e8a..f0c1d9921f 100644 --- a/lib/matrix.gi +++ b/lib/matrix.gi @@ -3792,7 +3792,7 @@ InstallGlobalFunction( BasisNullspaceModN, function( M, n ) # nullM is also the nullspace for M nullM := null*snf.rowtrans mod n; - Assert (1, ForAll (nullM, v -> v*M mod n =0*M[1])); + Assert (1, ForAll (nullM, v -> IsZero( v*M mod n ))); return nullM; end); @@ -4506,7 +4506,7 @@ function( mat ) w:= GcdRepresentation( g, Derivative( g ) )[2]; w:= w*g; B:= ShallowCopy( mat ); - while Value( g, B ) <> 0*B do + while not IsZero( Value( g, B ) ) do B:= B - Value( w, B ); od; diff --git a/lib/meatauto.gi b/lib/meatauto.gi index 90e08b97e7..fd44e4d04e 100644 --- a/lib/meatauto.gi +++ b/lib/meatauto.gi @@ -768,7 +768,7 @@ local nv, nw, F, zero, minusone, zeroW, gV, gW, k, U, echu, r, homs, s, work, an Add(hom, image); od; hom:=ImmutableMatrix(F,hom); - Assert(1,hom<>0*hom); + Assert(1,not IsZero( hom )); Add(newhoms, hom); od; diff --git a/lib/polyrat.gi b/lib/polyrat.gi index 7801641c9b..6602eb3f72 100644 --- a/lib/polyrat.gi +++ b/lib/polyrat.gi @@ -2029,7 +2029,7 @@ local x,xd,er,i,j,k,m,p,sel,xi,gamma,G,g,loop,zero,add; if k>xi/2 then k:=k - xi; #symmetric rep fi; - if k<>0*k then + if not IsZero( k ) then Add(g,gamma[j-1]); Add(g,k); fi;