Questions tagged [integer]

0 votes
2 replies
I am currently trying to save a set of integers in a int array, by redefining string into numbers, then store it in the array
I am trying to convert input text/numbers (string), which will include any characters, but I want to separate the numbers from the characters and...
asked 1 month ago
0 votes
5 replies
Convert integer to float
I am trying to write a function that converts integers to floats, and leave booleans and strings as they are. I have defined the following func...
asked 1 month ago
0 votes
1 replies
Is it possible to make an integer only recieve input for one single number instead of two?
I need to be able to input a series of integers on the same line, I cannot make them characters because I need to add the integers up. #include...
asked 1 month ago
0 votes
2 replies
How to pad integer printing with leading zeros?
So i have to make kinda like a timer and this has to be a string and it has to have a 0 before if it is smaller than ten so like 00,01,02...09,10...
asked 1 month ago
0 votes
0 replies
How do i convert from integer to binary in standard_logic (no vector) in vhdl
I am inputing into a seven segment display from a clock but the output right now from the clock is in integer. how do i convert it to binary?...
asked 1 month ago
-3 votes
0 replies
C++: How to get the separate digits of an int number using modulo?
I'm creating a program that is supposed to take each digit in a number and place it in a separate element in an array. For example, if the number...
asked 1 month ago
1 votes
1 replies
How to check basic integer order relations in sympy?
I have a (possibly relatively large) set of assumptions about multiple integers like {x > -1, x < 5, x != 2, y > 0, x-2 < y} and I wo...
asked 1 month ago
2 votes
2 replies
how can you append a number to a double in swift
I am trying to make a calculator app in swift as a practise for my IOS development course. for that app I am trying to append a number to an exis...
asked 1 month ago
9 votes
1 replies
What is the default integer type in Rust?
When doing something like: let mut sum = 5 + 10; What is the exact type of sum? Is it an arbitrary-size type which can’t be overflowed? 9...
asked 1 month ago
0 votes
0 replies
What is causing StackoverFlowError in my code?
I need to write two recusion methods. One of them checks candidate values which need to be enumerated from its most-significant to least-signific...
0 votes
1 replies
String cannot be converted to int array and ASCII
I have a problem with my code for ASCII and Morse arrays. As long as I know the casting is correct... The code uses functions and casting in ord...
asked 1 month ago
1 votes
1 replies
How to convert string to integer with parseInt?
I have this code: public static void main(String[] args) { List<Valtozas> lista = new ArrayList<Valtozas>(); try {...
asked 1 month ago
1 votes
1 replies
How to compare a class return with a float or integer?
I want to compare the __repr__ of a class with a float or an integer. class TestClass: def __init__(self, a = 5): self.a = a...
asked 1 month ago
1 votes
0 replies
Evenly distribute number X to number Y
So.. to best describe what I want to achieve using either JavaScript or HTML5 I will try to illustrate with an example: Say I have 100 boxes lin...
asked 2 months ago
0 votes
0 replies
How to use a field from sql select in subquery?
I'm trying to do a select query using a field in the subquery coming from the main query. The problem is, the field in the subquery named "t.cod...
asked 2 months ago
0 votes
2 replies
Why is my integer going up by 2 instead of 1?
I am doing a Tower of Hanoi assignment for homework. I am trying to increase the i variable by one each time but it is increasing by 2. Also, the...
asked 2 months ago
1 votes
2 replies
How to check if a integer is a cube or not in common lisp?
I need to define a lisp function iscube which takes an integer as an argument and returns T if n is a cube and nil otherwise. I only know how to...
asked 2 months ago
1 votes
1 replies
Better way to split list of integers based on values and rules
The goal is to split a list of integers based on each element's neighbors, based on these rules: (the current/focal value is smaller than or eq...
asked 2 months ago
0 votes
1 replies
Is it possible for int_least16_t to be an alias for int rather than short?
From the C99 standard, I can see that int_least16_t is guaranteed to have a width of at least 16 bits. 7.18.1.2 Minimum-width integer types...
asked 2 months ago
0 votes
0 replies
why use q = (i * 52429) >>> (16+3) rather than q= i /10 in the Integer of java?
In the source of Integer of Java why use q = (i * 52429) >>> (16+3) rather than q=i / 10? for speed? static void getChars(int i, int in...
asked 2 months ago
0 votes
3 replies
Reflective pattern of numbers in rows and columns of html table using loops
I'm stuck trying to use nested loops to make a reflective pattern from numbers. I've already tried, but the output looks like this: |0|1|2| |0|...
asked 3 months ago
1 votes
1 replies
Need solution to rand_range providing only floats and not integers - GDScript
For a project, I need to make use of a random number generator to provide random numbers as part of a Fisher-Yates Shuffle. I am using both rando...
asked 2 months ago
0 votes
1 replies
Elasticsearch in Python. How to get closes integer from search
I am using elasticsearch on a large indexed database. One of the queries requires to find an integer value and a string such as: s = Search(usin...
0 votes
1 replies
Elasticsearch in Python. How to get closes integer from search
I am using elasticsearch on a large indexed database. One of the queries requires to find an integer value and a string such as: s = Search(usin...
3 votes
3 replies
How do I convert my byte data to integer using python?
I have a byte data is like: b'\xc4\x03\x00\x00\xe2\xecqv\x01'. How do I convert this to integer like index by index. 3 It depends on how...
asked 3 months ago