You are here: Symbol Reference > AbstractMtxVec Namespace > Classes > TMtxVec Class > public > Rem Method > TMtxVec.Rem Method (TMtxVec, TMtxVec)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVec.Rem Method (TMtxVec, TMtxVec)

The Reminder after division X/Y.

Pascal
function Rem(const X: TMtxVec; const Y: TMtxVec): TMtxVec; overload;

Calculates reminder after division according to formula: 

x[i]-y[i]*Trunc(x[i]/y[i]). 

The results will be saved to the calling vector. X and Y must be a real and have the same length. Size and Complex properties of the calling vector are set implicitly to match the X object.

var a,b,c: TVec; begin CreateIt(a,b,c); try a.SetIt(false,[0,1,10,-1,-10]); // a = [0, 1, 10, -1, -10]; b.SetIt(false,[0,1,PI,-1,-PI]); // b = [0, 1, Pi, -1, -Pi]; c.Rem(a,b); // c = [0, 0, 0.5752, 0, -0.5752] finally FreeIt(a,b,c); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!