|
7.10.6.6 ncratSubstract
Procedure from library ncrat.lib (see ncrat_lib).
- Usage:
- ncrat h = ncratSubstract(f, g);
f, g both of type ncrat
- Return:
- h = f - g
- Note:
- operator '-' for ncrat is overloaded
with this procedure, hence
ncrat h = f - g;
yields the same result as
ncrat h = ncratSubstract(f, g);
Example:
| LIB "ncrat.lib";
ncInit(list("x", "y", "z"));
ncrat f = ncratFromString("2*x*y");
print(f);
==> 2*x*y
ncrat g = ncratFromString("z");
print(g);
==> z
ncrat h1, h2;
h1 = ncratSubstract(f, g);
print(h1);
==> 2*x*y-z
h2 = f - g;
print(h2);
==> 2*x*y-z
|
|