Questions tagged [numbers]

A number is a mathematical object used to count, measure and label. Questions about using numbers in variables processing, numbers processing, conversion, display, logical numerical changes, data type existence, etc. For questions regarding phone numbers, please use tag [phone-number].

0
votes
1answer
7 views

File reading in hexa editor

I am a bit curious about the file system and how a file is written in a disk. I have written 23 in a file. While opening this file in hex editor, I found this like below Why the hex editor is ...
0
votes
1answer
9 views

Typescript interface expect one number props to be less than another number prop

Is it possible to make a TypeScript interface accept a number prop that's value is always supposed to be less than another number prop in the interface? For example, if I had a numberOfFiles prop and ...
0
votes
1answer
38 views

Simple C random lottery number

I would like to generate 5 different numbers in the simplest way and put them into an array. Something is wrong with my way of thinking, could you please correct my code? void lottery(int *array){ ...
1
vote
1answer
18 views

ACF text field filter WordPress posts with a selectbox

I have in ACF a textfield and in that field are number values (ages of people) i know how to echo the field <?php the_field('age'); ?> but how can i make a selectbox with the function that you ...
-1
votes
3answers
34 views

Separate stream of numbers into groups of closer integers

I have a stream of numbers such as [2872, 2997, 3121, 13055, 14178, 14302, 23134, 23382, 23507, 32832, 33677, 34017, 43415, 44246, 44374, 52866, 54035, 54158, 62835, 64243, 64936, 73110, 73890, 74014,...
0
votes
0answers
20 views

Why 1.1 - 0.2 is not 0.9 in JavaScript? [duplicate]

Why do I get inaccurate results when I subtract simple float numbers in JavaScript? How can I get the results I expect? the correct results. > 1.1 - 0.2 < 0.9000000000000001 and > 7.1 - 0....
0
votes
0answers
15 views

React phone number validation using onKeyPress not working as i want it to

I am building my first React app and I want to validate a phone number, so I hooked up the input field with an "onKeyPress" event handler, but when I submit my form I always miss the last digit from ...
0
votes
5answers
77 views

Turning a list of letters into a list of numbers

I need to turn a list of numbers into a list of letters. More specifically, I need to read PZ and turn it into PZx, such that the first distinct letter appearing in PZ assumes in PZx the number 1, ...
1
vote
3answers
65 views

Changing value in if statement

I'm trying to iterate through a column in numbers and change the background color of a cell, if the cell has a certain background color. repeat with i from 11 to the count of cells by 6 ...
0
votes
1answer
47 views

Code efficiency in Scala loops, counting up or counting down?

Clearly, if you need to count up, count up. If you need to count down, count down. However, other things being equal, is one faster than the other? Here is my Scala code for a well-known puzzle - ...
-1
votes
1answer
18 views

Java code to find polygonal numbers based on input

I need a program that can do following example: "What is the number of sides of your polygon?" "3" "How many of these would you like to see?" "36" "1 3 6 10 15 21 28 36 45 55" "66 78 91 105 120 ...
0
votes
1answer
55 views

C++ comparing two numbers by their digits

I want to make a function, which returns true whenever two numbers provided on input are made up of the same digits (with no replacement). For example, 543 and 435 should return true, 10001 and 11000 ...
0
votes
0answers
43 views

how to find the position of prime number

Hey i have here an example which shows the value of the prime number entered but i want to make when i type any number to show either Not a prime number and the divisors or the position of the prime ...
-1
votes
1answer
31 views

Remove white spaces from number input without converting to string type

I have a number like this, let id = 5; Is there a way to remove white spaces around the number without converting it into a string first in javascript? PS: I wanted to delete this question when I ...
0
votes
2answers
36 views

Number Format Exception in service

Code final EditText wid = (EditText) myview.findViewById(R.id.width); final EditText hie = (EditText) myview.findViewById(R.id.height); Button mSave = (Button) myview.findViewById(R.id....
-1
votes
1answer
43 views

How to make this program more efficient?( Program to find whether the digits of a given number are in ascending order) [on hold]

I wrote this program to find whether the digits of an accepted integer are in any particular order( Ascending or Descending ) . Although it works , I'm stuck because I want to make it more efficient( ...
1
vote
1answer
17 views

SAS converting text to numeric F12.2 format error

I'm trying to convert a text variable into numeric and then back to text to round it and preserve trailing and leading zeroes so if my number is 0.501 I want to display 0.50 in SAS. I have come up ...
-3
votes
0answers
241 views

Write a program, which will find all such numbers between m and n (both included) such that each digit of the number is an even number [closed]

Write a program, which will find all such numbers between m and n (both included) such that each digit of the number is an even number Input Format: The first line contains value m and n separated ...
0
votes
0answers
26 views

How to see if there is a pattern between numbers in a database using python

I was working on a database using python and I was wondering if there was a way to determine if there was a pattern between the numbers in my database? I would like it to check if there is a pattern ...
0
votes
2answers
49 views

Make Random Numbers Generator with average value

I need to make random numbers generator without built-in function and with an average value of not more than 0.5. It must generate 10000 numbers and preferably they should not be repeated. For example ...
-3
votes
0answers
47 views

Carmichael numbers [closed]

I try to fight with this: enter image description here enter image description here Input The input will consist of a series of lines, each containing a small positive number n (2 < n < ...
1
vote
5answers
46 views

Every 1 second increase the value with a random number using decimal numbers

So I'm trying to increment the value of a number in an interval of 1 second with a decimal number between (0.01 and 0.05) and I can't seem to figure this out. The only thing that it does is to show ...
1
vote
1answer
54 views

C# How to generate random high or low numbers, and have each succeeding number be based off of the last randomly generated number

I'm currently creating a Guess Game via a Udemy course based on C# using Unity Engine. What I'm trying to do is outside the scope of the course. I got to the point you see below where when I press ...
-1
votes
1answer
22 views

Format numbers using JScript

I have numbers that I want to add a decimal point before the last 2 digits on the right. For example: 4000000 => 40000.00 1373917 => 13739.17 12399 => 123.99 I tried to use toFixed, but ...
1
vote
3answers
49 views

Trying to get all prime numbers in an array in Python

I am trying to print out all prime numbers that are in an array called 'checkMe'. But I just can't get it to work. I've succesfully made a program that checks it for one number but it doesn't work for ...
0
votes
4answers
70 views

Does a number as a character take less space than a number as an integer?

so for example does char x ='1'; take less space than int x = 1; or is it the same?
0
votes
1answer
45 views

Oracle integer stored with comma

I look at a oracle database and there is a column named score it is declared as INT(12,2). The values that are stored there look like this: 23487.31 0 322.3 So does it mean those are actual float ...
0
votes
0answers
18 views

Computing binary representation of a natural number as a sequence in R [duplicate]

I am trying to write a function which computes the binary representation of a natural number as a sequence of 0 and 1. I wrote it like this: binary<- function(n) {if(n > 1) {binary(as.integer(n/...
-3
votes
0answers
15 views

Sorting an array of numbers containing duplicate values [duplicate]

I've an array containing duplicate numbers. I need to sort them without using multiple loops using javascript. What is the best possible way to sort it? Current array: [0, 1, 2, 0, 3, 4, 2, 1, 4, 3]...
-1
votes
3answers
103 views

How many 8 digit numbers are there which are both divisible by 18 and every digit is either a 1, 2 or 3?

Solving this problem using python involves making sure that all the individual digits of numbers between 10,000,000 and 99,999,999 are 1, 2 or 3 and if the numbers are also divisible by 18. The answer ...
0
votes
1answer
31 views

How to format number input in angular

I have a number input like this and i want something like this (no matters what the sepparator will be) My actual code works as follows: <div class="row center-xs" *ngFor="let item of listItem;...
-1
votes
1answer
7 views

Binary representation - conversion in C++

a = 13; for (b = 8∗ sizeof(int)−1; b >= 0; b−−) cout << ( (a & (1U << b)) > 0 ); May anybody explain me, what happen in "cout"? Is it a condition? I mean, why it must be ">...
1
vote
3answers
67 views

Is there an isdigit function (overload) which includes the negative symbol?

I'm trying to search for the beginning of a number. isdigit is there a c++ function that can include negatives in isdigit? So that it will match the first character of the number: "-13"?
2
votes
1answer
39 views

How do I compare non integer numbers using freemarker templete

I use freemarker template in my Java application to load my pages in my Java Spring MVC Web Application. Usually, I use built-ins like gt, lt, lte, gte etc to compare two numbers. Currently I have a ...
0
votes
0answers
9 views

Trying to change my clickable number so it don’t open in new window

I am trying to change to code so my numbers stay clickable, but don’t open a new window on mobiles. I have had a good look around online but there is no code out there that looks like my one. This ...
3
votes
2answers
43 views

Jquery multiply value only if next input is greater than 1

Hopefully this will be a fairly easy question. I'm still learning jquery, so please bear with me and thank you for your patience. I couldn't find the answer by searching. I'm coding a fairly simple ...
4
votes
5answers
76 views

test if a string is a valid float in JavaScript

I want to test if a string can be cast as a float. I have been trying to use parseFloat to achieve this. console.log(!isNaN(parseFloat("10000"))); // should return true console.log(!isNaN(...
-1
votes
1answer
26 views

Newton.JSON Serialize number to Enum item [duplicate]

We want to serialize an object to JSON with Newton.JSON, but this Object use an enum and is then converted in the underlying int (see 'Datatype' in JSON below). How can ve proceed to get the "enum ...
0
votes
1answer
22 views

Need to cast string value representing a 0.XXXX floats to actual number value in PHP

So I am trying to cast a string value of ie: '0.0000143' to actual FLOAT or DECIMAL number value (so it must not be a string after conversion), but the actual number of 0.0000143 as it needs to be ...
0
votes
0answers
14 views

Seven number of Dedekind's Numbers

my question is about the Dedekind numbers. I wanted to write a code that printed the first seven numbers of Dedekind's Numbers, for that use the formula given by Andrzej Kisielewicz in 1988 (https://...
-1
votes
3answers
65 views

How to load calculation input from text file with Python?

I have a text file containing: Number Name subject1 subject2 subject3 subject4 subject5 1234567 Jan 5 7 0 6 4 3526435 Marie 5 5 7 0 0 2230431 Kees 6 10 0 8 6 7685433 André 4 7 8 7 5 0364678 ...
0
votes
1answer
29 views

programming python number in python program 3.6 version

Below is my code: Number = input("write your number: ") if tall.isdigit(): print("The number is integer") else: print("The number is a floating point") How does the python program ...
-1
votes
1answer
34 views

A prime number checker that fails

It seems like a normal code and works well, but for whatever reasons when I try entering this number = 18765411123451, computer seems to freeze, any clue? num = 18765411123451 if num > 1: for i ...
0
votes
2answers
37 views

how to match a number values from two files by perl

I have a two text file separate by tab. file 1: 21 114352848 6 73853300 17 53191768 13 28008170 35 ...
-2
votes
1answer
16 views

python library to generator previous and next prime quickly

is there a library in Python that, given an integer, can generate the previous and the next closest prime number. I know there are some that will give me the next prime number, but I was hoping there ...
-2
votes
1answer
45 views

How to make “3” in python?

I would like to make a variable including " and numbers such as "3". I tried as following: a ="3" but it showed a ='3', and a ='\"'+str(3)+'\"' or a ='"3"' it showed a ='"3"'. Please help ...
0
votes
1answer
23 views

String conversion discrepancy

I'm importing several sheets of data to another workbook and wanted a simple way of converting the strings that are numbers into numbers. So I found this code that did exactly what I wanted https://...
-1
votes
2answers
54 views

finding prime numbers c#

the program should ask for a number and print all the primes numbers between 1 to the number the user entered... why isn't it working? bool isPrime = true; int primes = 0; Console.WriteLine("Enter a ...
-3
votes
1answer
27 views

how to increment in number limit of 3 i.e 000 [closed]

i have a number limit i.e. 000 now i want to increment it by 1 so the next limit will be '001' but when i try to add it gives me '1', also if somehow i figure out to maintain it '001', the second ...
1
vote
1answer
34 views

Adding a suffix to duplicates in excel

I'm looking for some clarification to an answer that was found at the link below. Rename duplicates with random alphabets in a column - Excel The example shows how to add a prefix to duplicates in ...