Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const calculate = n => {
- if ((n < -8 || n >= 1) && n != 3 && n != 2 && n <= 4) {
- return 1 / (n * Math.exp(n * n));
- } else if ((n < 1 && n >= -4) || n == 3) {
- return Math.atan(n * n + 5) + Math.tan(n + 4.5) * Math.tan(n + 4.5);
- } else if ((n > 4 && n != 7) || n == -5) {
- return Math.sqrt(Math.abs(n) / 3 + n * n);
- } else if ((n < -4 && n >= -8 && n != -5) || n == 7) {
- return Math.log(n ** 4) / Math.log(9);
- } else {
- return 0;
- }
- };
- for (let i = -15; i <= 15; ++i) {
- console.log({
- i,
- value: calculate(i)
- });
- }
Add Comment
Please, Sign In to add comment