diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 22:21:05 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2007-05-03 22:21:05 +0000 |
| commit | 621d0f09fafba69aa650bc1555927f41e9c8e60e (patch) | |
| tree | 2a01644bf81c3e90c2afddad85ec359109f15f5a /pokemod/Frac.cpp | |
| parent | 7ed92969721c7b718da26b466bfa095185dfd4ed (diff) | |
| download | sigen-621d0f09fafba69aa650bc1555927f41e9c8e60e.tar.gz sigen-621d0f09fafba69aa650bc1555927f41e9c8e60e.tar.xz sigen-621d0f09fafba69aa650bc1555927f41e9c8e60e.zip | |
Update PokeMod to PokeGen::PokeMod
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@6 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Frac.cpp')
| -rw-r--r-- | pokemod/Frac.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/pokemod/Frac.cpp b/pokemod/Frac.cpp index 7a3ddbb1..2b0afe6e 100644 --- a/pokemod/Frac.cpp +++ b/pokemod/Frac.cpp @@ -23,7 +23,7 @@ #include "Frac.h"
-PokeMod::Frac::Frac(bool i)
+PokeGen::PokeMod::Frac::Frac(bool i)
{
Log("Frac: Initializing", PM_DEBUG_DEBUG);
num = 1;
@@ -31,13 +31,13 @@ PokeMod::Frac::Frac(bool i) improper = i;
}
-PokeMod::Frac::Frac(unsigned n, unsigned d, bool i)
+PokeGen::PokeMod::Frac::Frac(unsigned n, unsigned d, bool i)
{
Log(String("Frac: Initializing as %u/%u (%u)", n, d, i), PM_DEBUG_DEBUG);
Set(n, d, i);
}
-void PokeMod::Frac::ImportXml(XmlElement &xml)
+void PokeGen::PokeMod::Frac::ImportXml(XmlElement &xml)
{
LogImportStart("Frac");
String curName;
@@ -61,7 +61,7 @@ void PokeMod::Frac::ImportXml(XmlElement &xml) Log(String("Frac Import: Imported %u/%u", num, denom), PM_DEBUG_INFO);
}
-PokeMod::XmlElement PokeMod::Frac::ExportXml(const String &val)
+PokeGen::PokeMod::XmlElement PokeGen::PokeMod::Frac::ExportXml(const String &val)
{
Log(String("Frac Export: Starting %u/%u as %s", num, denom, val.c_str()), PM_DEBUG_INFO);
// Reduce fraction before storing
@@ -75,7 +75,7 @@ PokeMod::XmlElement PokeMod::Frac::ExportXml(const String &val) return exFrac;
}
-void PokeMod::Frac::Set(unsigned n, unsigned d)
+void PokeGen::PokeMod::Frac::Set(unsigned n, unsigned d)
{
Log(String("Frac: Setting to %u/%u", n, d), PM_DEBUG_DEBUG);
SetDenom(d);
@@ -83,13 +83,13 @@ void PokeMod::Frac::Set(unsigned n, unsigned d) Reduce();
}
-void PokeMod::Frac::Set(unsigned n, unsigned d, bool i)
+void PokeGen::PokeMod::Frac::Set(unsigned n, unsigned d, bool i)
{
SetImproper(i);
Set(n, d);
}
-void PokeMod::Frac::SetNum(unsigned n)
+void PokeGen::PokeMod::Frac::SetNum(unsigned n)
{
// Make sure the numerator is less than the denominator if proper
if ((n <= denom) || improper)
@@ -101,7 +101,7 @@ void PokeMod::Frac::SetNum(unsigned n) Log(String("Frac: Setting tried to set numerator to %u when denominator is %u", n, denom), PM_DEBUG_DEBUG);
}
-void PokeMod::Frac::SetDenom(unsigned d)
+void PokeGen::PokeMod::Frac::SetDenom(unsigned d)
{
// Make sure the denominator isn't 0
if (d)
@@ -119,43 +119,43 @@ void PokeMod::Frac::SetDenom(unsigned d) }
}
-void PokeMod::Frac::SetImproper(bool i)
+void PokeGen::PokeMod::Frac::SetImproper(bool i)
{
Log(String("Frac: Setting as %s", i ? "improper" : "proper"), PM_DEBUG_DEBUG);
improper = i;
Set(num, denom);
}
-unsigned PokeMod::Frac::GetNum()
+unsigned PokeGen::PokeMod::Frac::GetNum()
{
Log(String("Frac: Fetching the numerator (%u)", num), PM_DEBUG_DEBUG);
return num;
}
-unsigned PokeMod::Frac::GetDenom()
+unsigned PokeGen::PokeMod::Frac::GetDenom()
{
Log(String("Frac: Fetching the denominator (%u)", denom), PM_DEBUG_DEBUG);
return denom;
}
-bool PokeMod::Frac::GetImproper()
+bool PokeGen::PokeMod::Frac::GetImproper()
{
Log(String("Frac: Fetching improper (%u)", improper), PM_DEBUG_DEBUG);
return improper;
}
-float PokeMod::Frac::GetValue()
+float PokeGen::PokeMod::Frac::GetValue()
{
Log(String("Frac: Fetching the value (%f)", num / denom), PM_DEBUG_DEBUG);
return (num / denom);
}
-PokeMod::Frac::operator float()
+PokeGen::PokeMod::Frac::operator float()
{
return GetValue();
}
-void PokeMod::Frac::Reduce()
+void PokeGen::PokeMod::Frac::Reduce()
{
Log(String("Frac: Reducing %u/%u", num, denom), PM_DEBUG_DEBUG);
// Iterate until i is greater than the square root on num
|
