digit Questions
7
Solved
I am working on a program that requires me to read in and validate a number, but in doing so I need to take a two digit integer (for example we'll say 18) and add it 1 + 8. Now I have it working wh...
30
Solved
I would like to know how I can find the length of an integer in C.
For instance:
1 => 1
25 => 2
12512 => 5
0 => 1
and so on.
How can I do this in C?
5
Solved
I saw a question on a math forum a while back where a person was discussing adding up the digits in a number over and over again until a single digit is achieved. (i.e. "362" would become "3+6+2" w...
11
Solved
Say I have a multi-digit integer in C. I want to break it up into single-digit integers.
123 would turn into 1, 2, and 3.
How can I do this, especially if I don't know how many digits the integer...
7
I have string "ololo123".
I need get position of first digit - 1.
How to set mask of search ?
10
Solved
I'm trying to find the nth digit of an integer of an arbitrary length. I was going to convert the integer to a string and use the character at index n...
char Digit = itoa(Number).at(n);
...But t...
3
For C programming. How do i get numbers to be displayed as 00, 01, 02, 03, instead of 0, 1, 2, 3. I just need 0 before the number until 10.
i know when your doing decimals you can do "%.2f" etc. b...
5
Solved
for my selenium tests I need an value provider to get a 5-digit number in every case. The problem with javascript is that the api of Math.random only supports the generation of an 0. starting float...
Endothelium asked 1/2, 2010 at 8:46
7
Solved
I wish to output large numbers with thousand-separators (commas or spaces) — basically the same as in How to display numeric in 3 digit grouping but using printf in C (GNU, 99).
If printf does not...
4
Solved
I simply need to know how to make a regex that accepts a number that has up to 2 digits
All I have just now is
^[0-9]{2}$
Which would match a number with exactly 2 digits, but I don't know how...
8
Solved
I'm searching for an algorithm for Digit summing. Let me outline the basic principle:
Say you have a number: 18268.
1 + 8 + 2 + 6 + 8 = 25
2 + 5 = 7
And 7 is our final number. It's basically a...
7
Solved
As of C++14, thanks to n3781 (which in itself does not answer this question) we may write code like the following:
const int x = 1'234; // one thousand two hundred and thirty four
The aim is to ...
Altis asked 4/1, 2015 at 16:38
5
Solved
testing= testing.match(/(\d{5})/g);
I'm reading a full html into variable. From the variable, want to grab out all numbers with the pattern of exactly 5 digits. No need to care of whether before/...
Tigress asked 12/2, 2011 at 1:13
6
I want to write a predicate that an integer and a list of digits, and succeed if Digits contain the digits of the integer in the proper order, i.e:
?-digit_lists( Num, [1,2,3,4] ).
[Num == 1234].
...
3
I would like that all numbers generated by my knitr codes don´t look like an oldfashioned calculator.
Is there any option to get the numbers like the last one (with ·10 instead of e or E) ?
opt...
Furl asked 2/4, 2016 at 18:46
4
Solved
Im using the "De Bruijn" Algorithm to discover the number of digits in binary that a big number (up to 64bits) has.
For example:
1022 has 10 digits in binary.
130 has 8 digits in binary.
I fou...
Eyla asked 19/2, 2014 at 17:39
9
Solved
For example, getting "5" in "256". The closest I've gotten is Math.floor(256/10)), but that'll still return the numbers in front. Is there any simple way to get what I want or would I have to make ...
Demurrer asked 23/12, 2010 at 23:11
2
I wish to change an integer such as 23457689 to 689, 12457245 to 245 etc.
I do not require the numbers to be rounded and do not wish to have to convert to String.
Any ideas how this can be done i...
0
I am trying to show in my Android application the ARABIC-INDIC DIGIT.
So I tried this code, The method I used to display it is showed in the end of the class.
public class num extends Activity{
...
4
Solved
What is the most efficient way to get the digits of a number?
Lets begin with an example:
Imagine the Fibonacci sequence. Now lets say we want to know which Fibonacci number is the first to have ...
3
I have lot of digits and I want to add spaces in between them, like so:
0123456789 --> 0 1 2 3 4 5 6 7 8 9
I'm trying to do this using the search and replace function in Sublime Text. What I've t...
Kenton asked 22/6, 2014 at 19:42
2
Solved
I need to filter out only strings that contains only digits and/or a fix set of punctuation.
I've tried checking each character and then summing the Boolean conditions to check if it is equal to ...
Ciborium asked 11/2, 2014 at 8:27
7
How do I remove the first digit of an integer?
My input is an integer (for example i = 123456789).
I then want to remove the first digit, so that i equals 23456789.
3
Solved
I am dealing with a math example. I need to use 12 digit number for my code. So which datatype should i use, to use the number in my functions?
2
In an application I'm writing I want to display the current date and time, in English, but also in other locales.
For example Russian, Arabic and Chinese.
// DateTime.ToLongDateString doesn't sup...
Caudex asked 7/8, 2013 at 18:48
1 Next >
© 2022 - 2024 — McMap. All rights reserved.