1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Formatting

This commit is contained in:
Tom Poole 2023-09-29 16:41:53 +01:00
parent ff0cb4ad5b
commit 4153d59e39
279 changed files with 1281 additions and 1281 deletions

View file

@ -1005,7 +1005,7 @@ void BigInteger::montgomeryMultiplication (const BigInteger& other, const BigInt
void BigInteger::extendedEuclidean (const BigInteger& a, const BigInteger& b,
BigInteger& x, BigInteger& y)
{
BigInteger p(a), q(b), gcd(1);
BigInteger p (a), q (b), gcd (1);
Array<BigInteger> tempValues;
while (! q.isZero())
@ -1321,12 +1321,12 @@ public:
Random r = getRandom();
expect (BigInteger().isZero());
expect (BigInteger(1).isOne());
expect (BigInteger (1).isOne());
for (int j = 10000; --j >= 0;)
{
BigInteger b1 (getBigRandom(r)),
b2 (getBigRandom(r));
BigInteger b1 (getBigRandom (r)),
b2 (getBigRandom (r));
BigInteger b3 = b1 + b2;
expect (b3 > b1 && b3 > b2);

View file

@ -69,7 +69,7 @@ public:
virtual void visitAllSymbols (SymbolVisitor& visitor, const Scope& scope, int recursionDepth)
{
for (int i = getNumInputs(); --i >= 0;)
getInput(i)->visitAllSymbols (visitor, scope, recursionDepth);
getInput (i)->visitAllSymbols (visitor, scope, recursionDepth);
}
private:
@ -238,7 +238,7 @@ struct Expression::Helpers
Type getType() const noexcept { return functionType; }
Term* clone() const { return new Function (functionName, parameters); }
int getNumInputs() const { return parameters.size(); }
Term* getInput (int i) const { return parameters.getReference(i).term.get(); }
Term* getInput (int i) const { return parameters.getReference (i).term.get(); }
String getName() const { return functionName; }
TermPtr resolve (const Scope& scope, int recursionDepth)
@ -252,7 +252,7 @@ struct Expression::Helpers
HeapBlock<double> params (numParams);
for (int i = 0; i < numParams; ++i)
params[i] = parameters.getReference(i).term->resolve (scope, recursionDepth + 1)->toDouble();
params[i] = parameters.getReference (i).term->resolve (scope, recursionDepth + 1)->toDouble();
result = scope.evaluateFunction (functionName, params, numParams);
}
@ -267,7 +267,7 @@ struct Expression::Helpers
int getInputIndexFor (const Term* possibleInput) const
{
for (int i = 0; i < parameters.size(); ++i)
if (parameters.getReference(i).term == possibleInput)
if (parameters.getReference (i).term == possibleInput)
return i;
return -1;
@ -282,7 +282,7 @@ struct Expression::Helpers
for (int i = 0; i < parameters.size(); ++i)
{
s << parameters.getReference(i).term->toString();
s << parameters.getReference (i).term->toString();
if (i < parameters.size() - 1)
s << ", ";

View file

@ -149,7 +149,7 @@ struct MathConstants
/** A predefined value for Euler's number */
static constexpr FloatType euler = static_cast<FloatType> (2.71828182845904523536L);
/** A predefined value for sqrt(2) */
/** A predefined value for sqrt (2) */
static constexpr FloatType sqrt2 = static_cast<FloatType> (1.4142135623730950488L);
};
@ -276,8 +276,8 @@ static Tolerance<Type> relativeTolerance (Type tolerance)
differences that are subnormal are always considered equal. It is highly recommend this
value is reviewed depending on the calculation being carried out. In general specifying an
absolute value is useful when considering values close to zero. For example you might
expect sin(pi) to return 0, but what it actually returns is close to the error of the value pi.
Therefore, in this example it might be better to set the absolute tolerance to sin(pi).
expect sin (pi) to return 0, but what it actually returns is close to the error of the value pi.
Therefore, in this example it might be better to set the absolute tolerance to sin (pi).
The default relative tolerance is equal to the machine epsilon which is the difference between
1.0 and the next floating-point value that can be represented by Type. In most cases this value

View file

@ -215,7 +215,7 @@ public:
expect (! approximatelyEqual (nan, nan));
const auto expectNotEqualTo = [&](auto value)
const auto expectNotEqualTo = [&] (auto value)
{
expect (! approximatelyEqual (value, nan));
expect (! approximatelyEqual (nan, value));
@ -242,7 +242,7 @@ public:
expect (! approximatelyEqual (inf, -inf));
expect (! approximatelyEqual (-inf, inf));
const auto expectNotEqualTo = [&](auto value)
const auto expectNotEqualTo = [&] (auto value)
{
expect (! approximatelyEqual (value, inf));
expect (! approximatelyEqual (value, -inf));
@ -274,11 +274,11 @@ public:
(T) 0.0078125 /* 2^-7 */
};
const auto testTolerance = [&](auto tolerance)
const auto testTolerance = [&] (auto tolerance)
{
const auto t = Tolerance<T>{}.withAbsolute ((T) tolerance);
const auto testValue= [&](auto value)
const auto testValue= [&] (auto value)
{
const auto boundary = value + tolerance;