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
7.5.15.0. 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";) ./examples/negateNcfrac.s\
   ing:1
==> // ** redefining testNcloc (    LIB "ncloc.lib";) ncfrac.lib::mod_init:11\
   3
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)
==>