浮点数基本运算 浮点数的基本运算主要有四则运算、符号处理、大小比较,以及浮点数分柝等。 包含头文件 "fn.hpp" #include "fn.hpp" 浮点数基本运算 浮点数的基本运算中有加、减、乘、除、取负、绝对值、相等比较等。 加减乘除 加、减、乘、除四个运算极为相似,都是需要两个参数,结果当然也是浮点数了。 例子: // 加 减 乘 除 btil::fn::plus<f1, f2>::value // f1+f2 的结果 btil::fn::minus<f1, f2>::value // f1-f2 的结果 btil::fn::multiplies<f1, f2>::value // f1*f2 的结果 btil::fn::divides<f1, f2>::value // f1/f2 的结果 plus<f1, f2>::value::f_val // f1+f2 的结果的值 struct one { static const double f_val = 1.0 } // 两个浮点数 struct two { static const double f_val = 2.0 } minus<two, plus<divides<one, two>::value, one>::value >::value::f_val == 0.5 取负 取负运算就是取一个浮点数的负数。
上传时间: 2014-12-06
上传用户:exxxds
自己用C编写的小游戏,DOS界面哦,可以运行。 浮点数基本运算 浮点数的基本运算主要有四则运算、符号处理、大小比较,以及浮点数分柝等。 包含头文件 "fn.hpp" #include "fn.hpp" 浮点数基本运算 浮点数的基本运算中有加、减、乘、除、取负、绝对值、相等比较等。 加减乘除 加、减、乘、除四个运算极为相似,都是需要两个参数,结果当然也是浮点数了。 例子: // 加 减 乘 除 btil::fn::plus<f1, f2>::value // f1+f2 的结果 btil::fn::minus<f1, f2>::value // f1-f2 的结果 btil::fn::multiplies<f1, f2>::value // f1*f2 的结果 btil::fn::divides<f1, f2>::value // f1/f2 的结果 plus<f1, f2>::value::f_val // f1+f2 的结果的值 struct one { static const double f_val = 1.0 } // 两个浮点数 struct two { static const double f_val = 2.0 } minus<two, plus<divides<one, two>::value, one>::value >::value::f_val == 0.5 取负 取负运算就是取一个浮点数的负数。
上传时间: 2014-12-06
上传用户:jichenxi0730
Manufacturers of electronic systems that require power conversion are faced with the need for higher-density dc-to-dc converters that perform more efficiently,
标签: Manufacturers electronic conversion systems
上传时间: 2015-04-17
上传用户:diets
CBC下写的串口编程,API函数实例 I wish this site had been around when I was trying to figure out how to make serial communications work in Windows95. I, like many programmers, was hit with the double-whammy of having to learn Windows programming and Win95 serial comm programming at the same time. I found both tasks confusing at best. It was particularly frustrating because I had, over the years, written so much stuff (including lots of serial comm software) for the DOS environment and numerous embedded applications. Interrupt driven serial comm, DMA transfer serial comm, TSR serial comm, C, assembler, various processors... you name it, it had written it. Yet, everything I knew seemed upside-down in the message-driven-callback world of Windows.
上传时间: 2014-06-20
上传用户:cccole0605
The Audio File Library provides a uniform programming interface to standard digital audio file formats. This library allows the processing of audio data to and from audio files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun .snd/.au, IRCAM, AVR, Amiga IFF/8SVX, and NIST SPHERE). The library also supports compression (currently G.711 mu-law and A-law and IMA and MS ADPCM) as well as PCM formats of all flavors (signed and unsigned integer, single- and double-precision floating point).
标签: programming interface provides standard
上传时间: 2014-12-06
上传用户:a6697238
Routine mar1psd: To compute the power spectum by AR-model parameters. Input parameters: ip : AR model order (integer) ep : White noise variance of model input (real) ts : Sample interval in seconds (real) a : Complex array of AR parameters a(0) to a(ip) Output parameters: psdr : Real array of power spectral density values psdi : Real work array in chapter 12
标签: parameters AR-model Routine mar1psd
上传时间: 2015-06-09
上传用户:playboys0
最小二乘法曲线拟合 作者:佚名 文章来源:不详 点击数:164 更新时间:2006-1-4 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 //最小二乘法曲线拟合 typedef CArray<double,double>CDoubleArray BOOL CalculateCurveParameter(CDoubleArray *X,CDoubleArray *Y,long M,long N,CDoubleArray *A) { //X,Y -- X,Y两轴的坐标 //M -- 结果变量组数 //N -- 采样数目 //A -- 结果参数 文章录入:admin 责任编辑:admin
上传时间: 2014-01-24
上传用户:liansi
人民币大写金额转换程序(修正版v0.0.3) =================================== 1.使用方法: ------------- 将Cash_RMB.dcu放入Delphi安装目录下的Lib中,在uses中加入Cash_RMB, 即可引用CashRMB方法. function CashRMB(CashAmount: Double): String 如: procedure TForm1.Button1Click(Sender: TObject) begin QRLabel1.Caption := CashRMB(Table1.FieldByName( 金额 ).AsFloat) end 结果将传回人民币金额大写字符串. 如果 CashAmount = 0 或数值溢出(超出万亿位),结果返回空串. 2.说明: -------- A.本转换程序最大程度只支持到万亿元(位)的金额数值转换操作.如果你的 转换数值超出此极限,你可以在调用前先行判断数据的合法性,如果没有作预 先判断,转换过程中将引发本单元中自带的错误处理例程. b.该转换结果符合标准金额大写书写格式,零角零分等字样不存在于最终的 转换结果中. c.本转换程序自带数据溢出等数据非法及转换错误等处理例程. d.本程序适用于32位的Delphi版本.
上传时间: 2013-12-31
上传用户:hebmuljb
This demo develops the steady-state characteristics of an induction motor First start the simulation, then Double click the <PLOTS> block to view torque-speed and current-speed curves and the current circle diagram
标签: characteristics steady-state simulation the
上传时间: 2013-11-29
上传用户:daguda
暂时只支持jpeg2000支持的 cdf97 和spline53 可以这样来测试: x=imread( E:\study\jpeg2000\images\lena.tif ) % see the decomposition coefficients y=wavelift(x, 1, spl53 ) using spline 5/3 wavelet figure subplot(1,2,1) imshow(x) subplot(1,2,2) imshow(mat2gray(y)) % see the reconstruction precision yy=wavelift(x, 5) using cdf 9/7 wavelet ix=wavelift(yy,-5) inverse sum(sum((double(x)-ix).^2))
标签: 2000 imageslena studyjpeg imread
上传时间: 2014-01-14
上传用户:懒龙1988