Home Online Manual
Top
Back: ensureRightNcfrac
Forward: isInvertibleNcfrac
FastBack:
FastForward:
Up: ncfrac_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.15.25.9 negateNcfrac

Procedure from library ncfrac.lib (see ncfrac_lib).

Usage:
negateNcfrac(frac), ncfrac frac

Purpose:
compute the negative (i.e. additive inverse) of frac

Return:
ncfrac

Note:
returns (-1)*frac

Example:
 
LIB "ncfrac.lib";
==> // ** redefining testNcfrac (LIB "ncfrac.lib";)
==> // ** redefining testNcloc (    LIB "ncloc.lib";)
ring R = 0,(x,y,Dx,Dy),dp;
def S = Weyl();
setring S;
poly g = x*y^2+4*x+7*y-98;
ncloc loc = g;
ncfrac frac = list([g, 13*x^2], loc);
frac;
==> left repr.: (x*y^2+4*x+7*y-98,13*x^2)
==> right repr.: (0,0)
==> 
ncfrac negFrac = negateNcfrac(frac);
negFrac;
==> left repr.: (x*y^2+4*x+7*y-98,-13*x^2)
==> right repr.: (0,0)
==> 
frac + negFrac;
==> left repr.: (x*y^2+4*x+7*y-98,0)
==> right repr.: (0,0)
==>