mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
Revert gcd, too hasty in testing.
This commit is contained in:
parent
5379f830b1
commit
e0c33bf44d
@ -245,7 +245,7 @@ Fraction Fraction::setDenominator(const Fraction &a, uint16_t b)
|
|||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
// PRIVATE
|
// PRIVATE
|
||||||
// http://en.wikipedia.org/wiki/Binary_GCD_algorithm
|
// http://en.wikipedia.org/wiki/Binary_GCD_algorithm
|
||||||
int32_t& Fraction::gcd(int32_t &a , int32_t &b)
|
int32_t Fraction::gcd(int32_t a , int32_t b)
|
||||||
{
|
{
|
||||||
long c;
|
long c;
|
||||||
while ( a != 0 )
|
while ( a != 0 )
|
||||||
|
@ -64,7 +64,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void simplify();
|
void simplify();
|
||||||
double fractionize(double);
|
double fractionize(double);
|
||||||
int32_t& gcd(int32_t&, int32_t&);
|
int32_t gcd(int32_t, int32_t);
|
||||||
|
|
||||||
int32_t n;
|
int32_t n;
|
||||||
int32_t d;
|
int32_t d;
|
||||||
|
Loading…
Reference in New Issue
Block a user