example.cc

来自「这是一个从音频信号里提取特征参量的程序」· CC 代码 · 共 51 行

CC
51
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?