Questions tagged [digits]

Questions dealing with getting, manipulating, or changing the digits of numbers

Use this tag for questions dealing with getting, manipulating, or changing the digits of numbers. More about digits on wikipedia

1098 questions
2
votes
0 answers

How can I round the coefficient of a term containing symbolic variables in MATLAB?

Friends,I need to round off a term containing symbolic variables to zero when its coefficient is numerically very small value. For eg: in the following expression: 4.5*h + 6.12e-17*cos(q) I need to round off the second term to zero as its…
2
votes
4 answers

How to print decimal notation rather than scientific notation in Python?

Assume to have this number: p=0.00001 Now, if we print this variable we get 1e-05 (i.e., that number in scientific notation). How can I print exactly 0.00001 (i.e., in decimal notation)? Ok, I know I can use format(p, '.5f'), but the fact is that I…
redcrow
  • 1,743
  • 3
  • 25
  • 45
2
votes
1 answer

How to implement Digit Recognition?

I want to implement Digit Recognition for my Minor Project. But I've no idea where to start with the topic and also I don't know anything about various ways by which it can be done. Can someone provide various sources and links from where I can…
2
votes
2 answers

How to detect double-byte numbers

I have to check strings in Japanese that are encoded in double-byte characters (naturally the files aren't in Unicode and I have to keep them in Shift-JIS). Many of these strings contain digits that are also double byte characters, (123456789)…
Tensigh
  • 1,030
  • 5
  • 22
  • 44
2
votes
3 answers

Ruby Array - Delete first 10 digits

I have an array in Ruby and I would like to delete the first 10 digits in the array. array = [1, "a", 3, "b", 2, "c", 4, "d", 5, "a", 1, "z", 7, "e", 21, "q", 30, "a", 4, "t", 7, "m", 5, 1, 2, "q", "s", "l", 13, 46, 31] It would ideally…
George Lucas
  • 197
  • 1
  • 8
2
votes
3 answers

A quicker method for finding out the number of digits in a number and print it?

I have a question given by my computer teacher to find out the number of two digit number and three digit number and terminate the program (when user enter 0 )and print the total two digit ,three digit numbers and other digit number. This is an…
frunkad
  • 2,433
  • 1
  • 23
  • 35
2
votes
0 answers

C++ precision and truncation with file stream

I have a file.txt with hundreds of numbers. They have many digits (max 20) after the point and I need to get them all without truncation, otherwise they introduce errors in the following computations. I made these numbers with matlab so it has a…
user3290180
  • 4,260
  • 9
  • 42
  • 77
2
votes
2 answers

Given a number series, finding the Check Digit Algorithm...?

Suppose I have a series of index numbers that consists of a check digit. If I have a fair enough sample (Say 250 sample index numbers), do I have a way to extract the algorithm that has been used to generate the check digit? I think there should be…
2
votes
2 answers

What number is a specified digit and how many of them are there in a number?

Ok, so at first, I'm very beginner in programming. It's my school homework and I cannot use conversion to string. Just if,else,for,while. On input there is the number and the digit. I know how to get information what number is a specified digit in…
Václav Zeman
  • 606
  • 7
  • 21
2
votes
3 answers

maintain special pattern occurrences regex perl

I am trying to use perl regexp to normalize search strings in a search log against a library database. I need to remove all digit occurrences, would be: s/\d*//g except when I have a birth date like 1964- or a lifetime like 1903-1970 or…
2
votes
3 answers

replace decimal point from strings in entire column

I am working on a data set with columns with numbers like this: icd9code 285.21 593.9 285.21 v04.81 in order to run the R comorbidities package, I need to change them to 5 digits numbers without decimal points. so they need to look like…
Wendy
  • 144
  • 9
2
votes
2 answers

why is there significant double precision difference between Matlab and Mathematica?

I created a random double precision value in Matlab by x = rand(1,1); then display all possible digits of x by vpa(x,100) and obtain: 0.2238119394911369 7971853298440692014992237091064453125 I save x to a .mat file, and import it into…
LCFactorization
  • 1,652
  • 1
  • 25
  • 35
2
votes
2 answers

How do I extract short digit sequences from two different integers and compare them?

I'm new to Python and I'm having trouble with one of my assignment. So the question is: I have to obtain two positive integers from the user (one longer and one shorter). Then I have to loop through the longer integer (from left to right) and to…
unintendedjoy
  • 281
  • 2
  • 10
  • 18
2
votes
2 answers

Linux: search and remove in file, new line when it is between two lines of digits

I have a big text file that has this format: 80708730272 598305807640 45097682220 598305807660 87992655320 598305807890 598305808720 598305809030 598305809280 598305809620 564999067 598305809980 33723830870 As you can see there is a row of digits…
user2457193
  • 23
  • 1
  • 3
2
votes
2 answers

Is there an R function for deriving digits?

I have seen the solution in the past but forgot where: is there an R function that turns x=1234 into its digits (1,2,3,4) and vice-versa?