int Questions
5
Solved
This string returns the value: Pressure 770.3157279 mm
<div class="info">Pressure {{info.main.pressure * 0.750064}} mm </div>
How do I make the number become an integer and get:
Pres...
12
Solved
What is the shortest way, preferably inline-able, to convert an int to a string? Answers using stl and boost will be welcomed.
5
Solved
I am running the exact same code on both windows and mac, with python 3.5 64 bit.
On windows, it looks like this:
>>> import numpy as np
>>> preds = np.zeros((1, 3), dtype=int)...
Aland asked 11/7, 2016 at 18:51
15
I have a char[] that contains a value such as "0x1800785" but the function I want to give the value to requires an int, how can I convert this to an int? I have searched around but cannot find an a...
7
I have this question that has completely stumped me.
I have to create a variable that equals Integer.MAX_VALUE... (in Java)
// The answer must contain balanced parentesis
public class Exercise{
...
31
Solved
PHP has an intval() function that will convert a string to an integer. However I want to check that the string is an integer beforehand, so that I can give a helpful error message to the user if it...
19
Below is a code snippet,
int a = 1;
char b = (char) a;
System.out.println(b);
But what I get is empty output.
int a = '1';
char b = (char) a;
System.out.println(b);
I will get 1 as my output....
8
Solved
I'm currently working on an encryption/decryption program and I need to be able to convert bytes to an integer. I know that:
bytes([3]) = b'\x03'
Yet I cannot find out how to do the inverse. Wha...
Beutler asked 30/11, 2015 at 23:4
4
Solved
I would like to know how can I sort a string by the number inside.
As example I have:
hello = " hola %d" % (number_from_database)
bye = "adios %d" % (number_from_database_again)
I want to sort ...
28
Solved
How do I convert an integer to a hex string in C++?
I can find some ways to do it, but they mostly seem targeted towards C. It doesn't seem there's a native way to do it in C++. It is a pretty sim...
7
Solved
int i;
int data[5] = {0};
data[0] = i;
What's the value in data[0]?
Also, what's the meaning of this line?
if (!data[0]) { ... }
8
Solved
I want to take the nth digit from an N digit number in python. For example:
number = 9876543210
i = 4
number[i] # should return 6
How can I do something like that in python? Should I change it t...
8
Solved
What is the best way to return the whole number part of a decimal (in c#)? (This has to work for very large numbers that may not fit into an int).
GetIntPart(343564564.4342) >> 343564564
Ge...
11
Solved
I am trying to solve:
int total=0, number=0;
float percentage=0.0;
percentage=(number/total)*100;
printf("%.2f", percentage);
If the value of the number is 50 and the total is 100, I should get...
9
Solved
How do I divide two integers to get a double?
5
Kotlin Compilation Error : None of the following functions can be called with the arguments supplied
I have a class whose constructor takes 2 int parameters (null values are allowed).
Following is the compilation error.
None of the following functions can be called with the arguments supplied:
...
3
Solved
I have two integers, x and y. What I am trying to do, is combine the numbers in both, not add them together. I have tried to do this:
int x = 5;
int y = 10;
sum = x + y;
But that makes the outpu...
8
Solved
I'm fairly new to Java and I'm using BlueJ. I keep getting this "Int cannot be dereferenced" error when trying to compile and I'm not sure what the problem is. The error is specifically happening i...
4
Solved
Below is a section of code which is part of a functional decryption and encryption program.
while checkvar < maxvar: # is set to < as maxvar is 1 to high for the index of var
#output.append(...
5
Solved
I always assumed that booleans were more efficient than ints at storing an on/off value - considering that's their reason for existence. I recently decided to check if this is true with the help of...
Microsporangium asked 28/8, 2011 at 15:48
20
Solved
I have a char in c#:
char foo = '2';
Now I want to get the 2 into an int. I find that Convert.ToInt32 returns the actual decimal value of the char and not the number 2. The following will work:
...
11
Solved
I tried int.parse, and convert class to convert a string to int.
While I'm converting. I'm losing the 0 in the beginning which i don't want.
Ex : 09999 becomes 9999 - I don't want this.
I want t...
5
Solved
I want to store Zip Code (within United States) in MySQL database. Saving space is a priority. which is better option using VARCHAR - limited to maximum length of 6 digit or using INT or using MEDI...
10
Solved
How do I increment a Integer's value in Java? I know I can get the value with intValue, and I can set it with new Integer(int i).
playerID.intValue()++;
does not seem to work.
Note: PlayerID is...
8
In my program I'm looking at a string and I want to know if it represents a 32-bit integer.
Currently I first check if it is a digit at all using isdigit(), then I check if it exceeds the value of...
© 2022 - 2024 — McMap. All rights reserved.