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
1
vote
2 answers

Objective C: uint32_t stored as String, need to read as uint32_t

I am storing color values in a database for an iPad app that needs a legend with colors in it. Each entry has it's own color value, derived from a hex value. Basically, my colors all look like this: 0X######. I have functions that can take this…
CrystalBlue
  • 1,793
  • 5
  • 18
  • 27
1
vote
2 answers

How do I cast an UInt32 to a (negative) Int32 in PowerShell?

I have the following number of type System.UInt32: 4.294.967.176 (in bytes: FFFF FF88). I have to interpret this number as a number of type System.Int32, where it will be: -120 (in bytes still: FFFF FF88). In languages like C or C++ a simple type…
stackprotector
  • 10,498
  • 4
  • 35
  • 64
1
vote
2 answers

Problem of converting byte order for unsigned 64-bit number in C

I am playing with little endian/big endian conversion and found something that a is a bit confusing but also interesting. In first example, there is no problem using bit shift to convert byte order for type of uint32_t. It basically cast a uint32_t…
keye
  • 135
  • 1
  • 14
1
vote
1 answer

How to convert int into Uint32 in flutter

Is there a way to convert an integer into the format Uint32. int x = 94; Uint32 y = x.toUint32(); ///Pseudocode
GILO
  • 2,444
  • 21
  • 47
1
vote
0 answers

Error. Cannot assign value of type '[UInt32]' to type 'UInt32'

I get an error when i run my code saying : Cannot assign value of type '[UInt32]' to type 'UInt32' I have added some decent amount of code here, but the problem is within this line : torpedoNode.physicsBody?.contactTestBitMask = alienCategories I…
BCAAStian
  • 11
  • 3
1
vote
0 answers

How to re-write some c++ code from using uint64 to uint32_t

I have a mining program that is written in C++ for a cpu which is an adaptation of a popular monero v7 algorithm. Im trying to make this work on a gpu. The trouble is the monero gpu code is written in a different style so i cant direct copy and…
1
vote
1 answer

How to implement uint32 addition and subtraction operations in Ruby?

Please do not suggest using any gems or creating classes for unsigned integers. Input data - strings that represent 4 byte sequence. Output data should be the same type of string. This is what I've got so far: def addition(augend, addend) sum =…
MOPO3OB
  • 383
  • 3
  • 16
1
vote
2 answers

Why are random generated numbers UInt-32 by default in Swift?

I stumbled upon the fact that when a random number is generated in Swift, it is of type UInt32 by default instead of type Int What's the reason?
Emma V.
  • 99
  • 1
  • 8
1
vote
1 answer

How does the category bit mask work in SpriteKit?(0xFFFFFFFF)

I have trouble understanding how this bit mask work. I know that this is set to 0xFFFFFFFF by default and if you want two bodies to contact you set two different bitmask. My problem is how can I set 2(or more) different Bitmask, how can I change the…
B.Ticca
  • 23
  • 5
1
vote
0 answers

C - Convert between struct timeval and uint32_t to calculate elapsed time

I read a lot of posts on stackoverflow about endianness for network. For example, if I do something like this : struct timeval start_t gettimeofday(&start_t, NULL); Now , how can I be sure this kind of cast will work ? uint32_t receivedTime =…
jy95
  • 773
  • 13
  • 36
1
vote
1 answer

Error in reading uint32_t variable saved in a file

I have an issue with writing a uint32_t value to a file and reading it back. For writing it into a file, I use uint32_t num = 2036465665 ; FILE *fp = fopen("test.dat", "w"); fprintf(fp,"value = %" PRIu32 "\n", num); fclose(fp); For reading it, I…
marc
  • 949
  • 14
  • 33
1
vote
2 answers

Conversion to float in uint32_t calculation

I am trying to improve a SWRTC by modifying the definition of a second (long unsigned n_ticks_per_second) by synchronizing time with a server. #include #include int main(int argc, char * argv[]){ int32_t total_drift_SEC; …
PaulGWF
  • 13
  • 3
1
vote
5 answers

Concatenate char[] and uint32_t in C++

I want to concatenate a char[] with a uint32_t to get another char[] as result: char word[] = "hi"; uint32_t = 33; char result[] = "hi33"; //How can I get this ??? The goal is to assemble some data that can be passed to a WriteData method…
user7065967
1
vote
2 answers

Optimizing Bitshift into Array

I have a piece of code that runs at ~1.2 million runs per second after performing some tasks, the bulkiest is setting a uint8_t array with bitshifted data from two uint32_t pieces of data. The excerpt code is as follows: static inline uint32_t…
1
vote
1 answer

Getting the value of a C 4-byte string as a uint

Briefly, my problem is: I'm building a dynamic memory manager, which contains various different kinds of objects. I'm marking each different kind of object with a tag, and, to make memory debugging easier, I want those tags to appear in memory as…
Simon Brooke
  • 162
  • 2
  • 8