本文整理汇总了C++中openstudio::kilo方法的典型用法代码示例。如果您正苦于以下问题:C++ openstudio::kilo方法的具体用法?C++ openstudio::kilo怎么用?C++ openstudio::kilo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio
的用法示例。
在下文中一共展示了openstudio::kilo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG
TEST_F(UnitsFixture,Scale_LogicalOperators) {
LOG(Debug,"Scale_LogicalOperators");
// == and !=
ASSERT_TRUE(one() == one());
ASSERT_FALSE(one() == notDefined());
ASSERT_TRUE(kilo() != micro());
// <, <=, >, >=
ASSERT_TRUE(centi() < one());
ASSERT_TRUE(mega() > kilo());
ASSERT_TRUE(one() <= giga());
ASSERT_TRUE(milli() >= micro());
}
示例2: LOG
// Tests arithmetic operations, which relies on the factory method for creating
// scales from exponents.
TEST_F(UnitsFixture,ScaleFactory_ScaleOperations) {
LOG(Debug,"ScaleFactory_ScaleOperations");
// MULTIPLICATION
// exact match in factory
ScaleOpReturnType scaleResult = kilo()*milli();
ASSERT_EQ(scaleResult.first().exponent,0);
testNumbersEqual(1.0,scaleResult.second);
// exact match not in factory
scaleResult = centi()*kilo();
ASSERT_EQ(scaleResult.first().exponent,0);
testNumbersEqual(10.0,scaleResult.second);
// DIVISION
// exact match in factory
scaleResult = giga()/mega();
ASSERT_EQ(scaleResult.first().exponent,3);
testNumbersEqual(1.0,scaleResult.second);
// exact match not in factory
scaleResult = micro()/centi();
ASSERT_EQ(scaleResult.first().exponent,-3);
testNumbersEqual(0.1,scaleResult.second);
// POWER
// exact match in factory
scaleResult = pow(kilo(),3);
ASSERT_EQ(scaleResult.first().exponent,9);
testNumbersEqual(1.0,scaleResult.second);
scaleResult = pow(one(),12);
ASSERT_EQ(scaleResult.first().exponent,0);
testNumbersEqual(1.0,scaleResult.second);
// exact match not in factory
scaleResult = pow(centi(),-2);
ASSERT_EQ(3,scaleResult.first().exponent);
testNumbersEqual(10.0,scaleResult.second);
}