我的地盘我做主! 博客:http://tester2test.cnblogs.com/   msn:win_soft@163.com

loadrunner的atof函数有问题,请大家慎用!!!

上一篇 / 下一篇  2007-04-24 12:12:26 / 个人分类:其他

51Testing软件测试网z;K9B7t4fK)z

     float x;
+L^u%vk-U%_v0     char *s = "7.2339 by these hilts or I am a villian else";

P4UNYG e0

.M1CO|er,\%Mp {z0     x = atof(s);51Testing软件测试网 jM Ro \f'E
     /* The %.2f formatting string limits the output to 2 decimal places */51Testing软件测试网@"` J ?&PqZ
     lr_output_message("%.2f", x);51Testing软件测试网9j |1Y!l9x&SG"k%NO

OW2H6m*t6Y_ WM0应输出:7.23  51Testing软件测试网 [,C(V VZ7V jt0\
实际输出为:1244128.00(此值各个机器运行结果可能不同)

w]Z(~N!b$q.A0
+C!] s9{&N)M1l051Testing软件测试网-u%H \~G{O&^a
测试者家园 2006-06-09 09:59 发表评论
51Testing软件测试网t {X:cd}3B
51Testing软件测试网@o?K JOn1{f
Link URL: http://www.cnblogs.com/tester2test/archive/2006/06/09/421345.html

TAG:

yugisnow的个人空间 引用 删除 yugisnow   /   2009-05-06 14:35:38
那是因为你没有声明!!double atof ( const char *string );

loadrunner文档中说明:The function atof, as with all functions that do not return an integer, must be explicitly declared in Vugen scripts.
 

评分:0

我来说两句

Open Toolbar