本文整理汇总了C++中openstudio::giga方法的典型用法代码示例。如果您正苦于以下问题:C++ openstudio::giga方法的具体用法?C++ openstudio::giga怎么用?C++ openstudio::giga使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio
的用法示例。
在下文中一共展示了openstudio::giga方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG
TEST_F(UnitsFixture,Scale_DefinedConstants) {
LOG(Debug,"Scale_DefinedConstants");
// tests << via the log macro
LOG(Info,notDefined());
LOG(Info,yotta());
LOG(Info,zetta());
LOG(Info,exa());
LOG(Info,peta());
LOG(Info,tera());
LOG(Info,giga());
LOG(Info,mega());
LOG(Info,kilo());
LOG(Info,one());
LOG(Info,centi());
LOG(Info,milli());
LOG(Info,micro());
LOG(Info,nano());
LOG(Info,pico());
LOG(Info,femto());
LOG(Info,atto());
LOG(Info,zepto());
LOG(Info,yocto());
}
示例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);
}