📄 example.cc
字号:
// file: $isip/doc/examples/class/math/scalar/math_scalar_example_00/example.cc// version: $Id: example.cc,v 1.3 2000/12/17 18:17:44 hamaker Exp $//// isip include files//#include <Long.h>#include <Float.h>#include <Console.h>// main program starts here// this example shows how classes and operators can be used in place of// integral types//int main() { // declare some objects // Long a(2); Float b(2.0), c(3.5), d(3.0); Float e; // perform a simple math operation: // note that, due to precedence, the addition will take place // last. Since the variable 'a' is a Long object, the result of // (b * c) / d will be truncated before addition. // e = a + (b * c) / d; // output the value // e.debug(L"a + (b * c) / d"); // perform the same operation with all floating point numbers: // this time, since 'f' is a Float object, the result will not // be truncated before addition // Float f(2); Float g; g = f + (b * c) / d; // output the value // g.debug(L"f + (b * c) / d"); // exit gracefully // Integral::exit();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -