wine中complex::pow 补丁的实现
时间:2014-05-13 06:08:01
收藏:0
阅读:468
我发了一个wine的补丁,实现complex::
HongQian帮我在irc上问了Piotr对这个补丁的看法,他说:
“it generally looks ok but it‘s possible to implement it with better
precision, so I‘m not sure what to think about it”
“我想了想发现,其实我们在实现complex::pow
在指数为实整数的情况下的重载的时候,
我去查了一些资料,发现,以前初学C\C++用pow函数的时候有点疑惑,
然后我做了测试,这是在win下的结果:
pow(complex_float= (3.14159f, 0), 3): (31.006203,0.000000)
complex_translation: (31.006201,0.000000)
*******************************************************
pow(complex_float= (32.1234f, 0), 6): (1098826752.000000,0.000000)
complex_translation: (1098826624.000000,0.000000)
*******************************************************
pow(complex_float= (7.12f, 0), 6): (130280.640625,0.000000)
complex_translation: (130280.648438,0.000000)
*******************Now is complex_double************************************
pow(complex_double= (3.14159/2, 0), 3): (3.875775, 0.000000)
double_complex_translation: (3.875775, 0.000000)
*******************************************************
pow(complex_double= (32.12345678, 0), 13): (38787300223012692000.000000, 0.000000)
double_complex_translation: (38787300223012684000.000000, 0.000000)
*******************************************************
pow(complex_double= (7.12, 0), 33): (13546895790785450000000000000.000000, 0.000000)
double_complex_translation: (13546895790785442000000000000.000000, 0.000000)
*******************************************************
现在决定用用手写的底数为复数而指数为整数次幂的pow来解决
评论(0)