📄 systems.cpp
字号:
<< std::endl; std::cout << ml1 << " = " << quantity<fermi_length>(ml1) << std::endl << ml2 << " = " << quantity<fermi_length>(ml2) << std::endl << ml3 << " = " << quantity<fermi_length>(ml3) << std::endl << ml4 << " = " << quantity<fermi_length>(ml4) << std::endl << std::endl; std::cout << ml1 << " = " << quantity<angstrom_length>(ml1) << std::endl << ml2 << " = " << quantity<angstrom_length>(ml2) << std::endl << ml3 << " = " << quantity<angstrom_length>(ml3) << std::endl << ml4 << " = " << quantity<angstrom_length>(ml4) << std::endl << std::endl; std::cout << ml1 << " = " << quantity<micron_length>(ml1) << std::endl << ml2 << " = " << quantity<micron_length>(ml2) << std::endl << ml3 << " = " << quantity<micron_length>(ml3) << std::endl << ml4 << " = " << quantity<micron_length>(ml4) << std::endl << std::endl; std::cout << ml1 << " = " << quantity<nautical_mile_length>(ml1) << std::endl << ml2 << " = " << quantity<nautical_mile_length>(ml2) << std::endl << ml3 << " = " << quantity<nautical_mile_length>(ml3) << std::endl << ml4 << " = " << quantity<nautical_mile_length>(ml4) << std::endl << std::endl; quantity<ton_mass> mm1(1.0*tons); std::cout << mm1 << " = " << quantity<cgs::mass>(mm1) << std::endl //<< quantity<si::mass>(mm1) << std::endl // this should work... << std::endl; quantity<minute_time> mt1(1.0*minutes); quantity<hour_time> mt2(1.0*hours); quantity<day_time> mt3(1.0*days); quantity<year_time> mt4(1.0*years); std::cout << mt1 << " = " << quantity<si::time>(mt1) << std::endl << mt2 << " = " << quantity<si::time>(mt2) << std::endl << mt3 << " = " << quantity<si::time>(mt3) << std::endl << mt4 << " = " << quantity<si::time>(mt4) << std::endl << std::endl; std::cout << mt4 << "/" << mt1 << " = " << quantity<si::dimensionless>(mt4/mt1) << std::endl << mt4 << "/" << mt2 << " = " << quantity<si::dimensionless>(mt4/mt2) << std::endl << mt4 << "/" << mt3 << " = " << quantity<si::dimensionless>(mt4/mt3) << std::endl << std::endl; std::cout << mt1 << " = " << quantity<minute_time>(mt1) << std::endl << mt2 << " = " << quantity<minute_time>(mt2) << std::endl << mt3 << " = " << quantity<minute_time>(mt3) << std::endl << mt4 << " = " << quantity<minute_time>(mt4) << std::endl << std::endl; std::cout << mt1 << " = " << quantity<hour_time>(mt1) << std::endl << mt2 << " = " << quantity<hour_time>(mt2) << std::endl << mt3 << " = " << quantity<hour_time>(mt3) << std::endl << mt4 << " = " << quantity<hour_time>(mt4) << std::endl << std::endl; std::cout << mt1 << " = " << quantity<day_time>(mt1) << std::endl << mt2 << " = " << quantity<day_time>(mt2) << std::endl << mt3 << " = " << quantity<day_time>(mt3) << std::endl << mt4 << " = " << quantity<day_time>(mt4) << std::endl << std::endl; std::cout << mt1 << " = " << quantity<year_time>(mt1) << std::endl << mt2 << " = " << quantity<year_time>(mt2) << std::endl << mt3 << " = " << quantity<year_time>(mt3) << std::endl << mt4 << " = " << quantity<year_time>(mt4) << std::endl << std::endl; quantity<knot_velocity> ms1(1.0*knots); std::cout << ms1 << " = " << quantity<si::velocity>(ms1) << std::endl << std::endl; quantity<barn_area> ma1(1.0*barns); quantity<are_area> ma2(1.0*ares); quantity<hectare_area> ma3(1.0*hectares); std::cout << ma1 << " = " << quantity<si::area>(ma1) << std::endl << ma2 << " = " << quantity<si::area>(ma2) << std::endl << ma3 << " = " << quantity<si::area>(ma3) << std::endl << std::endl; std::cout << ma3 << "/" << ma1 << " = " << quantity<si::dimensionless>(ma3/ma1) << std::endl << ma3 << "/" << ma2 << " = " << quantity<si::dimensionless>(ma3/ma2) << std::endl << std::endl; std::cout << ma1 << " = " << quantity<barn_area>(ma1) << std::endl << ma2 << " = " << quantity<barn_area>(ma2) << std::endl << ma3 << " = " << quantity<barn_area>(ma3) << std::endl << std::endl; std::cout << ma1 << " = " << quantity<are_area>(ma1) << std::endl << ma2 << " = " << quantity<are_area>(ma2) << std::endl << ma3 << " = " << quantity<are_area>(ma3) << std::endl << std::endl; std::cout << ma1 << " = " << quantity<hectare_area>(ma1) << std::endl << ma2 << " = " << quantity<hectare_area>(ma2) << std::endl << ma3 << " = " << quantity<hectare_area>(ma3) << std::endl << std::endl; quantity<liter_volume> mv1(1.0*liters); std::cout << mv1 << " = " << quantity<si::volume>(mv1) << std::endl << std::endl; quantity<mmHg_pressure> mp1(1.0*mmHgs); quantity<torr_pressure> mp2(1.0*torrs); quantity<bar_pressure> mp3(1.0*bars); quantity<atmosphere_pressure> mp4(1.0*atmospheres); std::cout << mp1 << " = " << quantity<si::pressure>(mp1) << std::endl << mp2 << " = " << quantity<si::pressure>(mp2) << std::endl << mp3 << " = " << quantity<si::pressure>(mp3) << std::endl << mp4 << " = " << quantity<si::pressure>(mp4) << std::endl << std::endl; std::cout << mp4 << "/" << mp1 << " = " << quantity<si::dimensionless>(mp4/mp1) << std::endl << mp4 << "/" << mp2 << " = " << quantity<si::dimensionless>(mp4/mp2) << std::endl << mp4 << "/" << mp3 << " = " << quantity<si::dimensionless>(mp4/mp3) << std::endl << std::endl; std::cout << mp1 << " = " << quantity<mmHg_pressure>(mp1) << std::endl << mp2 << " = " << quantity<mmHg_pressure>(mp2) << std::endl << mp3 << " = " << quantity<mmHg_pressure>(mp3) << std::endl << mp4 << " = " << quantity<mmHg_pressure>(mp4) << std::endl << std::endl; std::cout << mp1 << " = " << quantity<torr_pressure>(mp1) << std::endl << mp2 << " = " << quantity<torr_pressure>(mp2) << std::endl << mp3 << " = " << quantity<torr_pressure>(mp3) << std::endl << mp4 << " = " << quantity<torr_pressure>(mp4) << std::endl << std::endl; std::cout << mp1 << " = " << quantity<bar_pressure>(mp1) << std::endl << mp2 << " = " << quantity<bar_pressure>(mp2) << std::endl << mp3 << " = " << quantity<bar_pressure>(mp3) << std::endl << mp4 << " = " << quantity<bar_pressure>(mp4) << std::endl << std::endl; std::cout << mp1 << " = " << quantity<atmosphere_pressure>(mp1) << std::endl << mp2 << " = " << quantity<atmosphere_pressure>(mp2) << std::endl << mp3 << " = " << quantity<atmosphere_pressure>(mp3) << std::endl << mp4 << " = " << quantity<atmosphere_pressure>(mp4) << std::endl << std::endl; } { using namespace boost::units::us; std::cout << "Testing U.S. customary base units..." << std::endl; quantity<mil_length> iml1(1.0*mils); quantity<inch_length> iml2(1.0*inchs); quantity<foot_length> iml3(1.0*foots); quantity<yard_length> iml4(1.0*yards); quantity<mile_length> iml5(1.0*miles); std::cout << iml1 << " = " << quantity<si::length>(iml1) << std::endl << iml2 << " = " << quantity<si::length>(iml2) << std::endl << iml3 << " = " << quantity<si::length>(iml3) << std::endl << iml4 << " = " << quantity<si::length>(iml4) << std::endl << iml5 << " = " << quantity<si::length>(iml5) << std::endl << std::endl; std::cout << iml5 << "/" << iml1 << " = " << quantity<si::dimensionless>(iml5/iml1) << std::endl << iml5 << "/" << iml2 << " = " << quantity<si::dimensionless>(iml5/iml2) << std::endl << iml5 << "/" << iml3 << " = " << quantity<si::dimensionless>(iml5/iml3) << std::endl << iml5 << "/" << iml4 << " = " << quantity<si::dimensionless>(iml5/iml4) << std::endl << std::endl; std::cout << iml1 << " = " << quantity<mil_length>(iml1) << std::endl << iml2 << " = " << quantity<mil_length>(iml2) << std::endl << iml3 << " = " << quantity<mil_length>(iml3) << std::endl << iml4 << " = " << quantity<mil_length>(iml4) << std::endl << iml5 << " = " << quantity<mil_length>(iml5) << std::endl << std::endl; std::cout << iml1 << " = " << quantity<inch_length>(iml1) << std::endl << iml2 << " = " << quantity<inch_length>(iml2) << std::endl << iml3 << " = " << quantity<inch_length>(iml3) << std::endl << iml4 << " = " << quantity<inch_length>(iml4) << std::endl << iml5 << " = " << quantity<inch_length>(iml5) << std::endl << std::endl; std::cout << iml1 << " = " << quantity<foot_length>(iml1) << std::endl << iml2 << " = " << quantity<foot_length>(iml2) << std::endl << iml3 << " = " << quantity<foot_length>(iml3) << std::endl << iml4 << " = " << quantity<foot_length>(iml4) << std::endl << iml5 << " = " << quantity<foot_length>(iml5) << std::endl << std::endl; std::cout << iml1 << " = " << quantity<yard_length>(iml1) << std::endl << iml2 << " = " << quantity<yard_length>(iml2) << std::endl << iml3 << " = " << quantity<yard_length>(iml3) << std::endl << iml4 << " = " << quantity<yard_length>(iml4) << std::endl << iml5 << " = " << quantity<yard_length>(iml5) << std::endl << std::endl; std::cout << iml1 << " = " << quantity<mile_length>(iml1) << std::endl << iml2 << " = " << quantity<mile_length>(iml2) << std::endl << iml3 << " = " << quantity<mile_length>(iml3) << std::endl << iml4 << " = " << quantity<mile_length>(iml4) << std::endl << iml5 << " = " << quantity<mile_length>(iml5) << std::endl << std::endl; quantity<grain_mass> imm1(1.0*grains); quantity<dram_mass> imm2(1.0*drams); quantity<ounce_mass> imm3(1.0*ounces); quantity<pound_mass> imm4(1.0*pounds); quantity<hundredweight_mass> imm5(1.0*hundredweights); quantity<ton_mass> imm6(1.0*tons); std::cout << imm1 << " = " << quantity<si::mass>(imm1) << std::endl << imm2 << " = " << quantity<si::mass>(imm2) << std::endl << imm3 << " = " << quantity<si::mass>(imm3) << std::endl << imm4 << " = " << quantity<si::mass>(imm4) << std::endl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -