Documentation Project 1
ContentsIndexHome
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
Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!