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

power calc error #42

Open
layerswing opened this issue Dec 30, 2019 · 1 comment
Open

power calc error #42

layerswing opened this issue Dec 30, 2019 · 1 comment

Comments

@layerswing
Copy link

layerswing commented Dec 30, 2019

2019-12-30-181250_1366x768_scrot_2
In galculator
263.4093759731027 * 2^(-12/1200) = 261,1833263
If I use comma the result is correct:
263,4093759731027 * 2^(-12/1200) = 261,589874507

but in java it is = 261.589874506641
class Main {
public static void main(String[] args) {
Double d_NoteFreq_TET = 263.4093759731027;
Double d_NoteFreq = 0.0;
int i_Cent = -12;
Double div = Double.valueOf(i_Cent) / 1200.0;
d_NoteFreq = d_NoteFreq_TET * Math.pow(2, div);
System.out.println("d_NoteFreq "+d_NoteFreq );
}
}
in js = 261.589874506641
https://jsfiddle.net/vr0s1h9p/

@layerswing
Copy link
Author

This is what it does:
2019-12-30-193157_1366x768_scrot

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