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
1 answer

Compute all possible numbers from given digits

The problem is simple. From given set of digits (there are max 10 digits), compute all numbers that can be madeform this digits (a digit can be used as many times it's is included in the set). Fist I think of using brute force and running through…
Stefan4024
  • 694
  • 1
  • 10
  • 21
2
votes
2 answers

how many digits in FLOAT?

I've looked all over and can't find this answer. How many actual digits are there for a MySQL FLOAT? I know (think?) that it truncates what's in excess of the FLOAT's 4 byte limit, but what exactly is that?
user1382306
2
votes
2 answers

Php Preg_Replace not matching quantity of characters

I'm trying to filter a string by preg_replacing. Anything but numbers and dot and no more than 5 numbers before the dot. PHP 5.4.3 under wamp(UptoDate). Good Matche: 0.01 0.1 12345.11 12345.1 1 12345 Bad…
2
votes
3 answers

ocaml looking at a specific digit of an int

I am writing an ocaml program and I can't figure out how to look at specific digits of an int so say for example we have let a = 405;; I want to be able to look at the first digit, 4, or the second one, 0. How can I accomplish this? I was thinking…
Charles Haro
  • 1,866
  • 3
  • 22
  • 36
2
votes
6 answers

FoxPro functions which determine if a variable is a character string or a numeric string

I'm looking for a Visual FoxPro function which is similar to the PHP function is_numeric(). I have found this, but I could not use VARTYPE or TYPE because the variable is always a character string which contains digits only. I found ISDIGIT()…
Sithu
  • 4,752
  • 9
  • 64
  • 110
2
votes
2 answers

Add space between numbers/digits and letters/characters

I have a code like this (function($, window, document, undefined) { $.fn.quicksearch = function (target, opt) { var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({ delay: 100, …
Kuba
  • 189
  • 3
  • 23
2
votes
4 answers

How to get all the digits at the beginning of a string?

How can I get all the digits at the beginning of a string? Here is an example string: 1&days=800&trans=9aq8ojjfka24qnl10ohktibfs1 In the example above, I would need to extract 1.
ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82
2
votes
7 answers

recursive function digits of a positive decimal integer in reverse order c++

I have an assignment to write a recursive function that writes the digits of a positive integer in reverse order. My problem is that the function doesn't display the reverse correctly. I know im supposed to use % or 10 when displaying the number and…
Kayla Bianchi
  • 67
  • 3
  • 5
  • 11
2
votes
1 answer

Convert string to array of single digit integers in Go

Spent several hours trying to find a solution to the 'simple' problem of converting a string of digits to an array of single digit integers in Go. Tried many different approaches, but always ran into a problem. Here is the last one tried. It builds,…
Yster
  • 3,147
  • 5
  • 32
  • 48
2
votes
2 answers

How to display 50 digits or more (for example in multiplication) in java?

I have project that ask me to design a calculator by java and I should put to chioices for the user to choice either display 50 digits or 100 digits. The problem as you know when I make the multiplication for example or any other operation with big…
cankord
  • 21
  • 2
2
votes
2 answers

Regex for matching digits followed by . (dot) then digits followed by . and so on

Currently I have this regex: [\d\.]+ I'm testing it with Regex Hero. You can check it working here. It correctly reports 5 matches for these values: 1.1.4.3. 11.1.2.4.4.4.5 2 4.4 2.1.1 The problem is that it also matches the final . in the first…
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
2
votes
3 answers

How can I return only the digits from a large string with symbols, letters and of course digits with C#

I have this code down here and I need to return the args.Content (my input data) with only digits and deleteing the rest of characteres. I've been trying many things with regular expressions but it didnt work for me. I have almost no idea of C# and…
1
vote
3 answers

Calculate number of decimal places for a float value WITHOUT libraries?

I need to calculate the number of decimal places for a float value, e.g. 1234.567 -> 3 2.1233 -> 4 4.2432 -> 4 My initial idea was: number = 1234.567; ... while (number - (int)number > 0.0) { // Count decimal places ... number *=…
user963395
1
vote
6 answers

Perl regex digit

Consider my regex in this code section: use strict; my @list = ("1", "2", "123"); &chk(@list); sub chk { my @num = split (" ", "@_"); foreach my $chk (@num) { chomp $chk; if ($chk =~ m/\d{1,2}?/) { print…
user1125595
  • 11
  • 1
  • 1
  • 2
1
vote
1 answer

Exponential limits for C and Matlab

In computers, the math operation of floating numbers is actually processed using the base number and the exponential number separately, and then combine them together. We learn this in our computation fundamental textbooks. However, I find the…
Leo
  • 15
  • 2