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
3 answers

C++: Setting a uint32 to an int32 (negative value)

I am debating whether I can get rid of a compiler warning or not. The warning comes from comparing an uint32 to -1. Now just from glancing at it this seems like an unwise thing to do since uint32 should never be negative yet I didn't write this…
TeeseCaprice
  • 55
  • 1
  • 13
0
votes
2 answers

C++ - Given multiple binary strings, produce binary string where n-th bit is set if in all given strings is n-th bit same

On input I am given multiple uint32_t numbers, which are in fact binary strings of length 32. I want to produce binary string ( a.k.a. another uint32_t number ) where n-th bit is set to 1 if n-th bit in every given string from input is same. Here…
johny
  • 13
  • 4
0
votes
1 answer

Memcpy uint32_t into char*

I testing a bit with different formats and stuff like that. And we got a task where we have to put uint32_t into char*. This is the code i use: void appendString(string *s, uint32_t append){ char data[4]; memcpy(data, &append,…
Niccoo
  • 11
  • 4
0
votes
1 answer

Parsing DateTime from an Int32Array binary conversion

Currently attempting to parse a managable datetime from a binary 'file'. Since the file is being uploaded in a web app, I am using javascript. var reader = new FileReader(); reader.readAsArrayBuffer( file ); var arrayBuffer = reader.result; var…
Hikalea
  • 119
  • 2
  • 10
0
votes
4 answers

Why is the value of this uint32_t -2147483648?

Using gcc compiler, why is this uint32_t -2147483648 when I set the MSB? It's unsigned - shouldn't it be positive? #include #include #define BIT_SET(a,b) ((a) |= (1<<(b))) int main() { uint32_t var = 0; BIT_SET(var,…
kibowki
  • 4,206
  • 16
  • 48
  • 74
0
votes
1 answer

KeyError with np.uint32 and numpy.uint32

First off the Error I get: import numpy as np dtype_range = {np.bool_: (False, True), np.bool8: (False, True), np.uint8: (0, 255), np.uint16: (0, 65535), np.int8: (-128, 127), np.int16:…
Nils
  • 910
  • 8
  • 30
0
votes
1 answer

Arduino: Generating CRC with FastCRC library (concatenating the uint32_t crc)

I'm using the FastCRC library for generating the CRC, and it returns an uint32_t; uint32_t crc = CRC32.crc32(buf, sizeof(buf)); The buf, which contains the message, is a uint8_t and I need to append the uint32_t crc at the end of the buf. The buf…
Valdir
  • 495
  • 2
  • 7
  • 20
0
votes
0 answers

Thread1: Breakpoint 1.4

So I just started to learn how to code. I was making an app that lets you guess a number from 0-5 which the phone has randomly generated. When I run the app I get an error saying "thread 1: Breakpoint 1.4"Check Image Also some additional information…
AriGold
  • 85
  • 1
  • 2
  • 4
0
votes
1 answer

Gradient effect with UInt32 Colors?

Hey I am new in programming and I want to know if it's possible to create a gradient effect having 2 colors (red and blue for example) of type UInt32. Any suggestions? Thanks ADDITION TO QUESTION The idea is that I have only pixels informations: …
0
votes
1 answer

How to unwrap an Optional value?

So I have this in my code. let hex:String = "#FFFFFF" var returnValue = UInt() var newString = String() newString = hex.replacingOccurrences(of: "#", with: "0x") returnValue = UInt(newString)! //This line gets an error It gives me an unwrapping…
Chris Mikkelsen
  • 3,987
  • 9
  • 29
  • 41
0
votes
1 answer

C: Correct Increment of uint8 big endian string

is there a correct way to increment a uint8 string in big endian format? For example i have: uint8 test[] = {0,0,0,1}; test[3]++; //works but is also somehow an increment with an typecast in this way possible? *test = (uint32) *test+1; //doesnt…
Hub
  • 1
0
votes
1 answer

Xamarin Forms - ResourceDictionary and value

It's a simple question, maybe stupid, but I'm stuck from hours.. I have that in the XAML part: 50
Emixam23
  • 3,854
  • 8
  • 50
  • 107
0
votes
3 answers

2^32 - 1 not part of uint32_t?

Here is the program whose compilation output makes me cry: #include int main() { uint32_t limit = (1 << 32) - 1; // 2^32 - 1 right? } and here is the compilation output: ~/workspace/CCode$ gcc uint32.c uint32.c: In function…
Simonlbc
  • 591
  • 1
  • 4
  • 16
0
votes
2 answers

Runtime error when taking user input for a range

I'm trying to create some code in Swift that will take a user input, from a UITextField object, create a range from that input from 1 to X(User inputted number), and then pick a random number out of that range. I am calling my user inputted text…
humans
  • 549
  • 8
  • 18
0
votes
2 answers

Saving UInt32 Values Into NSUserDefaults (Swift 2.0) error

I am very new to Swift 2.0 and am pretty stuck here... I have created a random number generator based off a user set range for low and high limits. This function worked great with my test function when I could set the variables for low and high to…