⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formula-with-inverse.h

📁 Ns2 TCP 协议改进 版本 提高goodput
💻 H
字号:
#include "formula.h"double b_to_p(double b, double rtt, double tzero, int psize, int bval) {	double p, pi, bres;	int ctr=0;	p=0.5;pi=0.25;	while(1) {		bres=p_to_b(p,rtt,tzero,psize, bval);		/*		 * if we're within 5% of the correct value from below, this is OK		 * for this purpose.		 */		if ((bres>0.95*b)&&(bres<1.05*b)) 			return p;		if (bres>b) {			p+=pi;		} else {			p-=pi;		}		pi/=2.0;		ctr++;		if (ctr>30) {			return p;		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -