首页 > 代码库 > wine中complex::pow 补丁的实现
wine中complex::pow 补丁的实现
我发了一个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来解决
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。