Questions tagged as 'int'

4
answers

How can I tell if the variable is an integer in Python?

How can I tell if the variable is an integer in Python? I know how to do this in PHP: is_int($variable); // bool(true) But how can I do it in Python? Example: numero = 1 #é numero nao_eh_numero = 'texto' # não é número     
asked by 10.01.2017 / 19:13
2
answers

You can concatenate numbers of type int

For example 10 and 12, concatenated would be 1012, this would not be string , it would have to be integer type, can you do that?     
asked by 08.02.2018 / 16:07
3
answers

Convert string number to PHP integer

I am converting a string to integer in PHP, however in the return of settype($variavel, "integer") , or (int)$variavel bring me a null value or equal to 1. Is there another way to try the conversion? The code I'm having is thi...
asked by 31.08.2015 / 21:22
3
answers

How to convert a String to Int in Javascript?

HTML5: <!DOCTYPE html> <html> <head> <title>JSTest</title> <meta charset="UTF-8"> <script src="JSource.js"></script> </head> <body> <input type="number" id="myinput...
asked by 11.06.2016 / 01:34
1
answer

What is the concept of signed integers in a programming language?

I would like to clarify the meaning of the term "signed integer". I'm researching on protocols, to build one in Java, and over and over meeting the term. I do not know what it's all about. I've always heard of primitive types, for example...
asked by 10.06.2017 / 23:48
2
answers

PHP value rounding error

I have a problem, after assigning a variable a float value as below, 4.85, after multiplying by 100, 48500 and when I will print out the value of 00000000484. $variavel = 4.85; $valor = $variavel * 100; echo sprintf("%011d",$valor);     
asked by 30.06.2014 / 14:02
1
answer

What is the difference of Integer.valueOf () when using String or int parameters?

Why are the results of System.out different in the lines below? Integer teste = Integer.valueOf("0422"); Resultado: 422 Integer teste = Integer.valueOf(0422); Resultado: 274 If you pass a int it changes the original value, no...
asked by 17.09.2014 / 16:15
1
answer

How to declare an integer variable in C #?

I'm learning C # to migrate a system in VBA to C #. I'm really enjoying the .Net language. How do I declare a variable of integer type?     
asked by 30.06.2016 / 23:41
3
answers

Is it possible to add int with str composed of text and numbers in Python?

I asked this question And in the case of python ? I can convert the string '1' str to 1 int . Example: 1 + int('1') # Imprime: 2 However, if I try to convert '1 cachorro' str to int ... int('1 c...
asked by 21.08.2015 / 18:46
1
answer

Overflow by multiplying two integers in BigInteger

I'm starting Java studies and I have one task: to generate two random integers and store their multiplication. For this, I tried to use long and BigInteger . But the result of this multiplication is almost always negative. Why? in...
asked by 29.04.2016 / 18:37