Most voted "whole" questions
the integers are made up of the natural numbers,1 including zero (0, 1, 2, 3, ...) and all negative numbers symmetrical to the non-zero natural numbers ( 1, 2, 3, 4 ...). 1 Two numbers are symmetrical if, and only if, their sum is zero.2 Sometimes, in pre-university education, these relative integers are called.
Learn more…31 questions
Sort by count of
-
17
votes4
answers3280
viewsInteger with 0 to the left is printed as another number
I have this code: $mob_numbers= array(02345674, 12345675, 22345676, 32345677); echo ($mob_numbers[0]); I wanted to print out the first element of array but the output that is: 641980 Why does that…
-
13
votes2
answers315
viewsfilesize for files larger than 2GB on x86 platforms
I was reading the PHP documentation and I noticed this information: Note: Because PHP’s integer type is Signed and Many Platforms use 32bit integers, some filesystem functions may Return Unexpected…
-
12
votes2
answers294
viewsCuriosity about equality of Integers
Why System.out.println(Integer.valueOf("0")==Integer.valueOf("0")); System.out.println(Integer.valueOf("1000")==Integer.valueOf("1000")); returns true false ? ps. I know that == is different from…
-
11
votes1
answer1637
viewsNumber in full for number
I would like to transform an extended number to normal int; example: FunçãoParaConverter("trinta e dois") // retorna 32 FunçãoParaConverter("mil vinte e quatro") // retorna 1024…
-
8
votes5
answers1617
views -
6
votes2
answers435
viewsWhat is the rule for converting a binary value to a negative number and vice versa?
I got a gift after the @Maniero answered that question: What is the ~ (til) operator for in PHP? How to obtain the negative value in binary? And how, through torque, to reach a negative value? In…
-
6
votes1
answer900
viewsMore elegant ways to invert integers, arrays and strings in Python
Hail! I’ve been looking for elegant ways to do string inversion, arrays and integers in Python. What do you think of my codes below and what suggest to improve them? They work... Thank you! frase =…
-
6
votes1
answer237
viewsRecursive function for integer number input
I have this code but it doesn’t work very well, I mean, if it’s whole at first numOfValues is correct, but if it is not gets the type None, for what remains in memory is the first input (which is…
-
5
votes1
answer2819
viewsMinimum bits required to represent a natural number
What is the most performative way to find the minimum number of bits needed to represent a natural number (i.e. no signal) in Javascript? There is a way to do without using loops? The code below for…
-
5
votes5
answers29639
viewsHow to convert an int number to string in python?
I need to do an exercise where I input an integer variable of 3 digits and the python has to show it reversed, but up to where I know an integer variable n can do this, but a string can. What can I…
-
4
votes2
answers180
viewsVery large integer does not work
My code is like this: #include <stdio.h> int main() { unsigned long int L, N; scanf("%lu%lu", &L, &N); printf("%lu\n", (L-(N-1))*(L-(N-1)) + (N-1)); return 0; } When the test case has…
-
4
votes1
answer9945
viewsHow to know if a number is integer
I need to develop an algorithm where, it divides a number by 2, until I get to the rest of the division, and I need to know if the rest of this division is an integer, what method can I apply to…
-
3
votes1
answer64
viewsWould an alphabetical sequence counter be possible?
I’m making a code in Pascal where one of my arrays has alphabet values (from A to Z) for a personal project of the type Questions and Answers/ Meaning A to Z: aux[1]:= 'a'; aux[2]:= 'b'; aux[3]:=…
-
3
votes2
answers2822
viewsHow to print an integer vector by removing the last comma in Python 3?
I want to print on the screen an array of integer numbers in the same line and separated by comma, and I want to remove the comma that is after the last number. How could I do that in Python? My…
-
3
votes1
answer107
viewsWhy can’t I store the value '4294967295' in a 4-byte integer?
I wonder why I can’t store the value '4294967295' in one int of 4 bytes and the quoted value converted to binary gives exactly 4 bytes (or 32 bits)?
-
2
votes1
answer3327
views -
2
votes2
answers816
viewsConvert hexadecimal to integer
I have this hexadecimal value "E365A931A000000". I need to convert it to integer I’m using the following code. string hex = "E365A931A000000"; CodLibercao = Convert.ToInt32(hex); This code is…
-
2
votes3
answers12149
viewsHow to check if a number is within a range in Python?
In Python, I would like to check if a number is within a range. There is a more pythonic way than the following code? if n >= 100 and n <= 200: ...
-
2
votes1
answer563
viewsc++ - How to return a value to a previous window in Qt?
Hello, I am developing a project where I will have many calls from new windows and need to recover a value from these windows to the main window (Mainwindow). The problem is that it becomes…
-
1
votes2
answers198
viewsHow to create variable to contain a number with millions of digits?
I saw a report about the discovery of a prime number that contains 22 million digits. How could a variable contain a number, for example, with 100 million digits.
-
1
votes3
answers69
viewsHow could I read a 3-digit value and print them on the screen reversed in C?
If I stored the '123' value in an integer type variable, how could I print the contents of the variable on the screen in reverse? For example, for the value '123' the expected output would be '321';…
-
1
votes3
answers38
viewsPHP integer value being modified for no apparent reason
Folks I’m having trouble with changing an integer number starting with zero. $agencia = 0736; $conta = 999999; $agencia = intval($agencia); $conta = intval($conta); echo($agencia); //resultado 478…
-
0
votes2
answers5760
viewsRead multiple integers in the same input in C
Basically, I must enter a number that represents the amount of integers to be entered. Then insert the integers themselves, separated by space, into the same input. Example: 5 1 2 3 4 5 I tried to…
-
0
votes1
answer224
viewsError reading %f and %e from a file in C
In the following excerpt of my code I have to read a function of a txt file and extract its coefficients. When I set the coefficients as integers and read them with %d works correctly, but when…
-
0
votes2
answers202
viewsInteger reading via console
Good evening, folks. A basic question: In the code below class Conversora { double Oneknot = 1.852; // km/h public void Conversor(){ Console.WriteLine("Informe a velocidade em nós: " ); int speed =…
-
0
votes0
answers167
viewsRead Entire with Bufferedreader on Android
In an Android application, I have a java socket client that sends integers (using writeInt) to a socket server on Android that I’m trying to read these integers. I receive correct strings but I…
-
0
votes1
answer224
viewsWhy does the variable x of the double type always print the same WRONG value in scientific notation?
In this first example I would like to know why the variable x read in double, when it is formatted by the function "printf()" does not display the value correctly, and every time the value is the…
-
0
votes0
answers101
viewsConvert integer to string in C
I have a problem with converting an integer to string in the scope of a function where the conversion return is given as null and I don’t know why. #include <stdio.h> char *getTexto(int num) {…
-
0
votes2
answers820
viewsC program does not correctly read a . txt file with integer numbers
I’m with this C code where the goal is to read 25 whole numbers of a text file and store them in a 5 by 5 array. The problem is that when running on MS-DOS, the program prints only junk from memory.…
-
0
votes2
answers860
viewsCheck if number is equal to the sum of squares of 4 consecutive prime numbers
I need to do a program where I type a number and the program checks if it is the sum of the square of 4 consecutive primes. Example: 2020 has to give 17 2 + 19 2 + 23 2 + 29 2 My code for now is…
-
-1
votes2
answers1715
viewsReturn entire part in Javascript
What’s the difference of these methods in Javascript? console.log(parseInt(3.3)); console.log(parseInt(3.7)); console.log(Math.floor(3.3)); console.log(Math.floor(3.7));…