Created
February 13, 2017 10:04
-
-
Save M-ZubairAhmed/c51691c9c990eabc29814d4ff0cf5f8d to your computer and use it in GitHub Desktop.
To check if a Number has decimal places
This file contains hidden or 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
/* | |
One of the easiest ways to check if a number after it comes back from some function is an Integer or not is to check its remainder with 1. eg. | |
if(Number % 1 == 0){ | |
print "this is a perfect integer"} | |
else{ | |
print "this is a real number with decimal places"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment