Void Subtract ( const FixPt &arg, FixPt &result ) const

From FM Plugin Wikipedia
Jump to: navigation, search

FixPt Subtract

This function allows you to subtract a given FixPt from another, and store the result in a third FixPt


In the following example, we will subtract 5 from 20, returning 15 in 'result'

// takes an initial 'value1', subtract 'value2' from it and store in 'result'

fmx::FixPtAutoPtr    value1,  value2,  result;

value1->AssignInt( 20 );
value2->AssignInt( 5 );

value1->Subtract( *value2 ,  *result );



In the next example, we will subtract 5 from our original value of 20

// takes an initial 'value1' and subtracts 'value2' from it

fmx::FixPtAutoPtr    value1,  value2;

value1->AssignInt( 20 );
value2->AssignInt( 5 );

value1->Subtract( *value2 ,  *value1 );