Skip to content

Instantly share code, notes, and snippets.

@peter279k
Created May 21, 2017 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peter279k/aaf919ae5ad4f4475a6a2cbf529eae07 to your computer and use it in GitHub Desktop.
Save peter279k/aaf919ae5ad4f4475a6a2cbf529eae07 to your computer and use it in GitHub Desktop.
TQC+ JAVA
public class JPA01 {
public static void main(String []args) {
double res = 0.0;
double []nums = {-3.2, -2.1, 0, 2.1};
for(int index=0;index<nums.length;index++) {
res = 3 * Math.pow(nums[index], 3) + 2 * nums[index] - 1;
System.out.printf("f(%s) = %.4f\r\n", nums[index], res);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment