Questions tagged [uint32]

uint32 is a datatype that represents an unsigned integer and is coded on 32 bits in memory.

uint32 is a datatype that represents an and is coded on 32 bits in memory. Unlike its counterpart which is , uint32 can only be used to store positive integers, of values between 0 and 232 - 1.

176 questions
0
votes
1 answer

Round does not accept argument type(Int)

I'm trying to create my app about a math test as I come to division. I know that I can't create repeating infinite decimals, and I must keep the numbers random. So after I generated the numbers out of arc4random_uniform, I'm trying to use the round…
Justsoft
  • 162
  • 4
  • 17
0
votes
2 answers

In C# should I use uint or int for values that are never supposed to be negative?

Possible Duplicate: Should I use uint in C# for values that can’t be negative? Suppose that the MaxValue of (roughly :) ) 2^31 vs 2^32 does not matter. On one hand, using uint seems nice because it is self-explanatory, it indicates (and…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
0
votes
2 answers

modify bits of uint32_t variable

I have an uint32_t variable and I want to modify randombly the first 10 less significant bits(0-9) and then,still randomly, I want to modify bits from 10th to 23th. I wrote this simple program in C++ and it works for the first 10 bits but not for…
Domenico
  • 19
  • 1
  • 5
0
votes
1 answer

Treatment of integers of different size

A general question about supporting and treatment of multiple different integer sizes and whether they should be treated as independent types (like string vs int) or one a subset of the other. Specifically I'm considering uint8_t and uint32_t. I…
Joey O
  • 95
  • 2
  • 10
0
votes
1 answer

how to take input for uint32_t variable

i have declared a variable as uint32_t num; when i take input for this variable i.e cin>>num; cout< when i run this program, i gives num value as 12345678, it works fine & give cout. but when i give input as 1234abcd. it creates problem & displays…
user349146
  • 39
  • 1
  • 3
0
votes
1 answer

Program outcome changes depending on printf usage

Here is my code that creates this problem; #include #define HASHPRINT(STRING) printf(STRING ": %p\n", simple_hash(STRING)) uint32_t simple_hash(const char *string) { uint32_t hash; char buffer[4]; /* 4 bytes = 32 bits */ …
yasar
  • 13,158
  • 28
  • 95
  • 160
0
votes
1 answer

UICollectionView Passing Data to another View when user clicks cell [SWIFT]

Basically i have made a app with Swift. i want to click on a cell. get the index of that cell and then from that index get a UInt32 from an Array. then pass that UInt32 to another View so i can use it to change the background colour of a View item.…
Ben Mason
  • 5
  • 4
0
votes
1 answer

Could not find an overload "init' that accept the supplied argument

var x = jokes[arc4random_uniform(UInt32(jokes.count))] Why does this line of code produce such error? When this code is written var x = jokes[Int(arc4random()%jokes.count)] This error appear Int is not convertible to UInt32
user3526002
  • 537
  • 2
  • 8
  • 19
0
votes
1 answer

Getting error from: dlen = uint32(0) ;

I don't know why but I am getting this error: Error in mr_lsbpex (line 3) dlen = uint32(0) ; Output argument "a" (and maybe others) not assigned during call to "E:\path\mr_lsbpex.m>mr_lsbpex" I have tested "dlen = uint32(0) ;" in matlab…
0
votes
1 answer

Why does UInt32(stringArray.count) count wrong in a function but correct alone in swift playground?

Why does this code count 6 elements, as 9 ("wrong") in swift playground. var stringArray = ["1", "2", "3", "4", "5", "6"] for var i = 0; i < 3; i++ { stringArray.append("Paragraph" + "\(i)") } func concat (array: [String]) -> String { let…
KML
  • 2,302
  • 5
  • 26
  • 47
0
votes
1 answer

why am I getting a negative value in taking a timestamp?

Uint64_t a; Uint32 b; a= clock_cycles(); b= uint32((a*1000000)/(SYSPAGE_ENTRY(qtime)->cycles_per_sec)); printf("RECEIVE from Time in microseconds: %ld\n", b); I created the variable and taking the timestamp and converting that into uint32 as…
0
votes
2 answers

NHibernate - How to store UInt32 in database

What is the best way to map UInt32 type to sql-server int type with NHibernate. The value is a picture width/height so negative value are not make sense here. But maybe I should use int because NHibenate doesn't support unassigned ints.
Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96
0
votes
3 answers

Best pratice for typedef of uint32

On a system where both long and int is 4 bytes which is the best and why? typedef unsigned long u32; or typedef unsigned int u32; note: uint32_t is not an option
0
votes
2 answers

How to read UInt32 numbers of bytes with binary reader?

I need my code to do something like this - Somewhere in the code num gets a value and after that i want to read from file EXACTLY as bytes is the number num. For example: If num is 39382 i need to read 39382 bytes and place them into byte[]…
Georgi
  • 519
  • 4
  • 19
0
votes
2 answers

Textbox to unsigned integer with plus or times

My current code: UInt32 example = Convert.ToUInt32(tb_address.Text, 16); Problem is if I'm peeking into an address like this: 0x83e3ba3c + 0x15 toUint32 will obviously return an error and say no. Anyway I could go about having operators handled…