Last active
October 16, 2020 00:37
-
-
Save vitorpacheco/d4980e765bf8d93b056bb2bbcd56a34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
static void calc_err(float xb, float x) { | |
float erroAbsoluto = Math.abs(x - xb); | |
float erroRelativo = Math.abs(erroAbsoluto/xb); | |
System.out.printf("%.5f %.5f\n", erroAbsoluto, erroRelativo); | |
} | |
public static void main(String[] args) { | |
calc_err(9.24956f, 9.238f); | |
calc_err(4.24499f, 4.243f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment