Questions tagged [uint]

is a type of variable and is used to store the equivalent of a mathematical non-negative integer

Due to the limited amount of memory a computer can handle, uint can represent just a subset of positive integers.

In C the uint standard is unsigned int and uses 4 bytes of memory (and thus can represents all integers int the range 0 to 4,294,967,295)

192 questions
0
votes
1 answer

Objective-c decode UInt8 array of unsigned chars

I'm trying to decode the following object, the variable is called data and is of type UInt8. (UInt8 [520]) data = { [0] = '\xff' [1] = '\0' [2] = '2' [3] = '\0' [4] = 'H' [5] = '\0' [6] = 'o' [7] = '\0' [8] = 's' [9] = '\0' …
Jacob Tomlinson
  • 3,341
  • 2
  • 31
  • 62
0
votes
1 answer

Need help in Unit Test using Moq for the particular code

I have created the DataColumn class. Now I want to do unit test using Moq. How i should write code for this? [Serializable] public class DataColumn : IDataColumn { private string columnName = null; private T defaultValue; …
PRV
  • 1
0
votes
4 answers

using uintX_t performance

I had a discussion with the team lead who told me that using uintX_t is very problematic and causes performance problems...I can't understand why.... using uint8_t and uint16_t is the same as unsigned char and unsigned short - I don't think that…
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
0
votes
2 answers

What does UInt(0) mean?

I read that UInt(1) refers to a 1-bit decimal literal. I'm confused about what UInt(0) could mean. It is used in a Counter code that goes as follows :- package TutorialSolutions import Chisel._ object Counter {` `def wrapAround(n:…
0
votes
1 answer

How do I get the hexadecimal value from a Color object in Actionscript 3.0?

So I am making a music visualizer and I am trying to set the linestyle for my graphics to be a pre defined color! But I get an error when trying var lineColor:Color = new Color(120,120,12); graphics.lineStyle(lineThickness, lineColor); 1067:…
Moscoso
  • 11
  • 2
0
votes
2 answers

Calculation differences

I have something like this in c# byte a; byte b; byte c; c = a + b; and it gives an error for c = a + b and says "Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a…
DebareDaDauntless
  • 471
  • 2
  • 7
  • 12
0
votes
3 answers

Issue writing/reading a uint to a binary file

I am writing a struct to a binary file in C. The char* items and the uint8 items are writing fine, but i seem to be having an issue writing the uint32 item. my writing code is here. void writeOut(record *data){ FILE *fp =…
TrewTzu
  • 1,110
  • 2
  • 11
  • 27
0
votes
1 answer

convert byte array to uint numeric value

Let's say I have array of bytes byte[] byteArr = new byte[] { 1, 2, 3, 4, 5 }; I want to convert this array to get regular numeric variable of uint, so result will be uint result = 12345; So far all the example I've seen were with bytes, byte I…
inside
  • 3,047
  • 10
  • 49
  • 75
0
votes
1 answer

Deserialize xml string to uint property

Is it possible to deserialize a XML file with MyValue is 0x0001 and deserialize it to an uint property? What's the best way to implement this? public class MyClass { private string myValue; public uint MyValue { //checkValue…
Odrai
  • 2,163
  • 2
  • 31
  • 62
0
votes
3 answers

How can I force subtraction to be signed in Python?

You can skip to the bottom line if you don't care about the background: I have the following code in Python: ratio = (point.threshold - self.points[0].value) / (self.points[1].value - self.points[0].value) Which is giving me wrong values. For…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
0
votes
1 answer

UInt8 EXC_BAD_ACCESS

I have a method that will add a filter to an image. This worked fine until a couple of months ago, now when I try to use this method the application will crash on the images buffer. I create the buffer and set it to the image's data, accessing the…
0
votes
2 answers

Loading a BigInteger with a large, positive, number

I'm trying to port a code from .NET which uses UInt64 everywhere, I've mostly succeeded using BigInteger, but unfortunately I've become stuck at something really simple as loading a BigInteger with a value from a table of hex values. At some point I…
SoManyGoblins
  • 5,605
  • 8
  • 45
  • 65
-1
votes
1 answer

What does this C Pointer Code Produce? [ulong pointer -> uint]

Hey Peeps, Am currently working on porting some old C Library to C# but have a bit of trouble understanding a certain piece of Code containing Pointers. Am not the best when it comes to C so i might be lacking some understanding. Heres a simplified…
RedCube
  • 25
  • 4
-1
votes
1 answer

Numpy overflow with np.divide(). RuntimeWarning: overflow encountered in ushort_scalars

I am running the following code on 2 images: ndvi = np.divide(img8 - img4, img8+img4) invalid = (ndvi > 1).any() if invalid: print("Stopping Execution") print(ndvi) img8 and img4 are 2 images and have all positive values. ndvi is…
Raghav Arora
  • 148
  • 1
  • 14
-1
votes
2 answers

How to copy uint8* to vector correctly

I am trying to make a vector of Uint8 from Uint8*, but for reason some of the values are not same. Here is my code. std::vector wav_vector = {}; Uint8* wav_buffer_; for (unsigned int i = 0; i < wav_length_; i++) { …
aak
  • 107
  • 1
  • 4
  • 12
1 2 3
12
13