Posted April 05, 2020
I have just realized that there is a way to do some simple calculations in your web browser (assuming it supports things like JavaScript). Some of you may already know about this (especially if you're a web developer), but for the benefit of those who don't, here is how to do this:
1. Press Ctrl+Shift+I. This will open up a panel on the right side of the browser window with a bunch of stuff.
2. Look for a tab titled "Console" and click on it. (This might or might not be necessary, depending on the browser.)
3. Scroll to the bottom of the window. There should be a ">" prompt there.
4, Type in a math expression, and press Enter, and your browser will calculate it for you. For example, if you type "1 + 1", you will get 2.
Explanation:
* By following these instructions, you just opened the browser's JavaScript console, one of the many tools that modern browsers provide to assist with web development. Hence, the math expression you entered was interpreted by the browser's JavaScript interpreter, and it just so happens that mathematical expressions are valid JavaScript expressions, which the interpreter will happily evaluate and print the result for you. You can actually put even more elaborate JavaScript here, like loops and even function definitions, which can be useful for more complex tasks, or even if you just want to play around with JavaScript.
* Of course, this also means that you will be subject to the usual limitations and quirks of JavaScript. For example, everything is represented as a 64-bit float, so 2 ** 53 == 2 ** 53 + 1, and 1 / 5 isn't exactly representable. ("**" is the exponentiation operator.)
* This method, of course, assumes that you are using a desktop browser on a system with a keyboard; I do not know if there is a way to do this on mobile.
* On the other hand, you don't actually need an internet connection to use the JavaScript console.
1. Press Ctrl+Shift+I. This will open up a panel on the right side of the browser window with a bunch of stuff.
2. Look for a tab titled "Console" and click on it. (This might or might not be necessary, depending on the browser.)
3. Scroll to the bottom of the window. There should be a ">" prompt there.
4, Type in a math expression, and press Enter, and your browser will calculate it for you. For example, if you type "1 + 1", you will get 2.
Explanation:
* By following these instructions, you just opened the browser's JavaScript console, one of the many tools that modern browsers provide to assist with web development. Hence, the math expression you entered was interpreted by the browser's JavaScript interpreter, and it just so happens that mathematical expressions are valid JavaScript expressions, which the interpreter will happily evaluate and print the result for you. You can actually put even more elaborate JavaScript here, like loops and even function definitions, which can be useful for more complex tasks, or even if you just want to play around with JavaScript.
* Of course, this also means that you will be subject to the usual limitations and quirks of JavaScript. For example, everything is represented as a 64-bit float, so 2 ** 53 == 2 ** 53 + 1, and 1 / 5 isn't exactly representable. ("**" is the exponentiation operator.)
* This method, of course, assumes that you are using a desktop browser on a system with a keyboard; I do not know if there is a way to do this on mobile.
* On the other hand, you don't actually need an internet connection to use the JavaScript console.