Questions tagged [digit]

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

See Wikipedia page on numerical digits.

375 questions
1
vote
1 answer

MATLAB generate random integer with random digit in array

First question: I am trying to generate random integers with random digits into an array. However, since boundary value of integer varies as 'int8', 'int16','int32', 'int64' and unsigned versions of them, I cannot decide which type I should use to…
Özge
  • 59
  • 7
1
vote
5 answers

11 Digit random number in Java

I have to generate an eleven digit ID number but when I use random package, it says that it is out of range, so how can I make it eleven? public static int generateID(){ Random r = new Random(); int numbers = 1000000000 +…
Ekin
  • 37
  • 1
  • 2
  • 9
1
vote
3 answers

Codewars. Some tests are passed, but i need to get tests which outputs the following mistake: 3263 should equal -1

Can you explain it what problems are here? To my mind, this code is like a heap of crap but with the right solving. I beg your pardon for my english. the task of this kata: Some numbers have funny properties. For example: 89 --> 8¹ + 9² = 89 *…
1
vote
1 answer

Divide all numbers in a file by 10 (or delete last digit of every number)

Good morning all, I have a series of files in which some lines are text-only and do not matter, and others which look like this: size=xxxx These numbers range from single-digit to six digits. What I would like to do is divide every number in…
1
vote
1 answer

Display illimited rational number defined by two integer

I'm working on a Rational number class in c++. The Rational number is defined by two int (numerator and denominator). I would like to display it properly as digit number. for now, I determine if the number is an "illimited" or a limited digit…
Hugo Hismans
  • 173
  • 1
  • 1
  • 8
1
vote
3 answers

Detecting when an integer is made up of only the same digit

I'm writing a Java program that will play a game. Basically you choose the no. of players and rounds, then the program shows you what every player should say, in order, considering the following rules: -assuming the players are standing in a…
Mario
  • 13
  • 3
1
vote
2 answers

CSS class will not work due to some magic hidden digits

I have a
with a class and want to assign a basic style to it. Somehow, my editor Atom seems to have messed up this code. I have copied and pasted .my { background: yellow; } out of my editor, which does not work. Then I have added two…
Marian Rick
  • 3,350
  • 4
  • 31
  • 67
1
vote
2 answers

Detecting a locale-sensitive digit in C

I've been trying to detect whether or not a certain wchar_t is considered a digit according to the current locale. At first, I tried using iswdigit, but then I realized it only returns 1 for 0-9, so it isn't locale-sensitive at all. Then I tried…
kirbyfan64sos
  • 10,377
  • 6
  • 54
  • 75
1
vote
1 answer

Does Unicode have a code point for a garbled digit?

I'm looking for a placeholder glyph to display "insert any digit here", to tersly communicate in limited GUI space that a range of numbers is meant. For decimal numbers I would use x, e.g. 1xx - room numbers on first floor 2xx - room numbers on…
Ludwig Schulze
  • 2,155
  • 1
  • 17
  • 36
1
vote
2 answers

Java: Count the number of integers in a string

I cant quite work out what i am doing wrong. I am trying to count the amount of digits in an inputted string but for example, if the number is 21 i want to count that as 1 inputted digit in the string. So far i have the following but i can't work…
user3411748
  • 55
  • 1
  • 1
  • 6
1
vote
1 answer

Matlab - OCR function digits recognition

Recently I'm trying to detect digits from images in Matlab and I encountered a problem: a clear visible '1' on photo below (and many similar) 1 is not detected by 'ocr' function. Could you tell me how can I preprocess this image to allow this…
1
vote
1 answer

How can I keep 1 million digit in Java?

My question is that, I want to multiply 2 number which has 1 million digit. When I tried to assign 1 million number to BigInteger, Compiler is giving to me error. The error is that:"constant string too long".
1
vote
2 answers

regex : minimum total number of digits in a string

I'm trying to know how many digits there is in a string that is essentially like a password. For now I have this regex : ^(?=.*[0-9]{3,})([a-zA-Z0-9_/+*.-]{6,})$ It works great when their is 3 digits in a row but not when they are separated in the…
rXp
  • 617
  • 2
  • 12
  • 25
1
vote
1 answer

Dynamic Content Loading - HTML5 is OK, Dojo is not

I've got a situation where I am loading DIV's dynamically from a server with dojo.xhrGet. All that is fine. The content comes back fine, and the DIV is inserted into the page fine. Note that in this situation, I cannot know the DIV to load prior…
JMorgan
  • 85
  • 1
  • 11
1
vote
2 answers

Why does the following python digitSum code gives the wrong answer?

digitSum=0 n=222222222222222222222222222222 while n!=0: digitSum=digitSum+(n%10) n=int(n/10) print(digitSum) The output should be 60, whereas the output is 86.