You can multiply them together; if they have the same sign, the result will be positive.
bool sameSign = (n1 * n2) > 0
More Related Contents:
- Come up on hover [closed]
- How i can add one function to multiple classes (like button) [closed]
- Trying to use fetch and pass in mode: no-cors
- How to convert file to base64 in JavaScript?
- How to fix Array indexOf() in JavaScript for Internet Explorer browsers
- Fast stable sorting algorithm implementation in javascript
- Why is {} + {} no longer NaN in Chrome console?
- AngularJS – Value attribute on an input text box is ignored when there is a ng-model used?
- How do you put an image file in a json object?
- How to create an auto-complete combobox?
- Adding code to a javascript function programmatically
- Bootstrap 4 navbar not collapsing on large screen
- Javascript: filter array of objects by array of strings
- Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)
- Is there a better way of writing v = (v == 0 ? 1 : 0); [closed]
- this.href vs $(this).attr(‘href’)
- How to keep cascade dropdownlist selected items after form submit?
- How to check if input date is equal to today’s date?
- What are “class fields” in JavaScript?
- How do I measure the execution time of JavaScript code with callbacks?
- How to take a snapshot of HTML5-JavaScript-based video player?
- How to load a PKCS#12 Digital Certificate with Javascript WebCrypto API
- Is there a way to use variable keys in a JavaScript object literal?
- How to allow access for importrange function via apps script?
- Should one use for-of or forEach when iterating through an array? [duplicate]
- Difference between \r and \n
- Why aren’t methods of an object created with class bound to it in ES6?
- Classic scripts vs. module scripts in JavaScript
- Chrome extension: Checking if content script has been injected or not
- How to set up Python server side with javascript client side