Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating point operation is very inaccurate #98

Open
elvin-du opened this issue Dec 19, 2019 · 0 comments
Open

Floating point operation is very inaccurate #98

elvin-du opened this issue Dec 19, 2019 · 0 comments

Comments

@elvin-du
Copy link

`
C standard library referenced by POW function < math. H >,result as follows:

double ww = pow(3.0, 0.3) = 1.1293469354568555
double xx = pow(2.2, 0.3) = 1.029005759421095
float yy = powf(2, 0.3) = 1.2311444
float yy = powf(2.4, 0.3) = 1.3003594
long double zz = powl(2, 0.3) = 1
long double mm = powl(2.3, 0.3) = 1.04282000071553305
double aa = pow(1.12, 0.5) = 1.0583005244258363

result using Calculator as follows:

pow(3.0, 0.3) = 1.3903891703159093404852542946161
pow(2.2, 0.3) = 1.2668546920110241257762468650659
powf(2, 0.3) = 1.2311444133449162844993930691677
powf(2.4, 0.3) = 1.3003593134073364931694839670248‬
powl(2, 0.3) = 1.2311444133449162844993930691677
powl(2.3, 0.3) = 1.2838620180052701355554021438659‬
pow(1.12, 0.5) = 1.0583005244258362362006463014557
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant