Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::math::fraction::SetFractionV Macro
C++
#define SetFractionV(f,w,n,d) (  (d)? \
    ((((f).numerator=((int)((n)*(w))) )  \
    ,((f).denominator=((int)(d)))),(f))  \
    :    ((((f).numerator=((int)((w))) )  \
    ,((f).denominator=((int)(1)))),(f))  \
)
Parameters 
Description 
fraction 
the fraction to set 
this is the whole number to set 
numerator of remainder to set 
denominator of fraction to set. 

Sets the value of a FRACTION. This is passed as the whole number and the fraction.

Fraction f = 3 1/2;

FRACTION f;
SetFractionV( f, 3, 1, 2 );
// the resulting fraction will be 7/2
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!