Questions tagged [isinteger]

isinteger is a MATLAB built-in function

isinteger(A) returns true if the array A is an integer type and false otherwise.

Ref. isinteger

24 questions
1
vote
8 answers

PHP: Variable is int but can't perform calculation

$bal = (int)$balance; echo is_int($bal); $balance is from a file_get_contents($webservice); I am using (int) to convert a string to integer. is_int returns 1 for true as verification. Because the value of $bal is always negative, I do the…
thisisready
  • 623
  • 2
  • 10
  • 22
1
vote
5 answers

Basic Java: Method to tell if a double is an integer

I'm a beginning programmer and I need a method that returns whether or not a double is an integer. The problem occurs when the number is too big for an int to hold. Here's what I have: private static boolean isInteger(double n){ int ni = (int)…
d361
  • 23
  • 2
0
votes
3 answers

Conditional is_int with variable check?

I've got this snippet of code that I am trying to understand what it does.. Any help would be awesome $returnValue= 0; if (is_int($bottleNumber/12)){ $returnValue=1; } echo $_GET['callback']. '('. json_encode($returnValue) . ')';
jeffimperial
  • 73
  • 3
  • 11
0
votes
2 answers

how can display any variable contant integer value is_int()?

I have this code: $showCountSql = "select cad_count from counteraccountdtl WHERE cad_userid =".$_SESSION['UID']." LIMIT 1"; $showCountresult = mysql_query($showCountSql); $showCountrow = mysql_fetch_array($showCountresult); $newCount =…
Manoj Patil
  • 35
  • 1
  • 1
  • 9
0
votes
3 answers

PHP integer type getting lost on function call

I have some code that pulls database primary keys and iterates through them by calling a function. When I get the key from the database and do a is_int($key) it returns true. I then call a function: thisfunction($key) In the calling function, I…
Mel
  • 3,855
  • 4
  • 24
  • 19
0
votes
1 answer

isIntegar polyfill fix on IE11

I have some JavaScript that uses isIntegar, I understand I need to add polyfill but am confused on how to do this with my code. IE dose not currently like my code My code if (!Number.isInteger(averageRatingResult)) { for (var j = 0; j <…
Benjamin Oats
  • 573
  • 1
  • 8
  • 25
0
votes
2 answers

python is.integer() malfunctioning

I was doing a test, calculating the minimum n such that for 1/a + 1/b = 1/n, there are at least x distinct solutions. (a, b, n, x are positive integers) I checked b = 1/(1/n - 1/a) and tested b with is.integer(), and the result surprised me. x =…
user2165
  • 1,951
  • 3
  • 20
  • 39
0
votes
2 answers

Create new array from integer elements of another array? MATLAB

I have created an array tP which contains a mix of integer and non-integer elements. I want to create a new array of the integer element. The result I would like is in the same form as is returned for, for example: tP2=find(tP>300); That is, a list…
KLMac
  • 25
  • 3
0
votes
1 answer

check if decimal $var is_int, then run round()

Im trying to write a function that will check if a $var is a number (i was trying to trying to use is_int()) and if it is then run round(). The only problem is that for round() im using a number like 123.25, which as in understand isn't an int,…
sam
  • 9,486
  • 36
  • 109
  • 160
1
2