·´ÕýÇÐÈý½Çº¯ÊýµÄcÔ´´úÂë
ijЩ³¡ºÏ£¬ÈçÓÎÏ·¿ª·¢£¬¹¤³Ì¼ÆËãÖУ¬¿ÉÄÜÐèÒª¼ÆËã·´Èý½Çº¯Êý£¬ÏÂÃæÊǼÆËã·´ÕýÇÐÈý½Çº¯ÊýµÄcÔ´´úÂëʵÀý£º
atan_self(double x)
{
//atan(x)=x-x^3/3+x^5/5-x^7/7+.....(-1<x<1)
//return:[-pi/2,pi/2]
double mult,sum,xx;
sum=0;
if(x==1){
return pi/4;
}
if(x==-1){
return -pi/4;
}
((x>1||x<-1)?mult=1/x:mult=x);
xx=mult*mult;
for(int i=1;i<200;i+=2){
sum+=mult*((i+1)%4==0?-1:1)/i;
mult*=xx;
}
if(x>1||x<-1){
return pi/2-sum;
}
else{
return sum;
}
}
Ö÷ÒªÊÇÀûÓÃÈý½Ç¼¶ÊýµÄÕ¹¿ª¹«Ê½½øÐнüËƼÆËã¡£
Ïà¹ØÎĵµ£º
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. ldexpº¯Êý
ldexpº¯ÊýµÄ¹¦ÄÜÊǼÆËãvalue*2µÄÃÝ£¬ÆäÓ÷¨Îª£ºdouble ldexp(double value, int exp);³ÌÐòʵÀýÈçÏ£º
......
#include <iostream>
#include <io.h>
#include <sys\stat.h>
#include <afx.h>
#define _AFXDLL
using namespace std;
void main()
{
// ´ËÎļþÔÚ¹¤³Ì´ò¿ª×´Ì¬ÏÂΪ²»¿É·ÃÎÊ
char* f ......
Ðí¶à±à³ÌÓïÑÔÖеĵ÷Óú¯ÊýµÄÁ½ÖÖ·½·¨ÊÇ°´Öµµ÷ÓÃ(call-by-value)ºÍ°´ÒýÓõ÷ÓÃ(call-by-reference)¡£
²ÎÊý°´Öµµ÷Óô«µÝʱ£¬Éú³É²ÎÊýÖµ¸±±¾²¢ÇÒ´«¸ø±»µ÷Óú¯Êý£¬¸±±¾µÄ¸Ä±ä²¢²»Ó°Ïìµ÷ÓÃÕßµÄÔʼ±äÁ¿Öµ£¬ÕâÑù¾Í¿ÉÒÔ·ÀÖ¹ÒâÍâµÄ¸±×÷ÓÃÓ°Ï쿪·¢ÕýÈ·£¬¿É¿¿µÄϵͳ¡£°´Öµµ÷ÓõÄÒ»¸öȱµãÊÇ£¬Èç¹û´«µÝ½Ï´óµÄÊý¾ÝÏÔò¸´ÖÆÕâ¸öÊý ......
1.1= Óë ==
Àý1£º
±¾ÀýÖÐÑ»·Óï¾äµÄ±¾ÒâÊÇÌø¹ýÎļþÖеĿոñ·û¡¢ÖƱí·û¡¢»»Ðзû
while(c=''||c=='\t'||c=='\n')
c=getc(f);
c= ''||c=='\t'||c=='\n'
ËÀÑ»·
Àý2£º
if((filedesc==open(argv[i],0))<0)
error();
ÓÀÔ¶²»»á±»µ÷ÓÃ
1.2 & ºÍ | ²»Í¬ÓÚ&& ºÍ||
1.3 CÓ ......