Omgili - forum search, search forums  
  

Discussions about unsigned int

Displaying 1 - 10 out of 8,587 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Suppose I have one long long int and want to take its bits and construct four unsigned short ints out of it. Particular order doesn't matter much here. I generally know that I need to shift bits and truncate to the size of unsigned short int. But I think...
Started by on , 4 posts by 4 people.  
(unsigned short)((((unsigned long long int)value)>>(x))&(0xFFFF)) where....
Long long int long_long_int; unsigned short int short_ints[sizeof(long long int) / sizeof(short int.
The code is return min + static_cast<int>(static_cast<double>(max - min + 1.0) * (number / (UINT_MAX + 1.0))); number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (inclusive). If you ...
Started by on , 6 posts by 6 people.  
You could do the arithmetic in an unsigned long long instead of a double, but only.
You should always do it by using high-order bits, as in j = 1 + (int) (10.0 * (rand() / (RAND_MAX to double anyway.
I have an application where part of the inner loop was basically: double sum = 0; for (int i = 0; i != N; ++i, ++data, ++x) sum += *data * x; If x is an unsigned int, then the code takes 3 times as long as with int! This was part of a larger code-base...
Started by on , 3 posts by 3 people.  
int to doubles, but do not have a hardware conversion from unsigned to double, so the compiler software conversion from unsigned int to double may very well be suboptimal (it almost certainly [ebp-4] 0040E6E2 fstp qword ptr....
Ask your Facebook Friends
Is there a method that converts string to unsigned int? _ultoa exists but couldn't find the vise verse version...
Started by on , 5 posts by 5 people.  
#include <boost/lexical_cast.hpp> [...] unsigned int x = boost::lexical_cast<unsigned does under the covers): #include <sstream> [...] std::stringstream s(strVal); unsigned int x; s >> x; ....
#include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt); return 0; } Output...
Started by on , 13 posts by 12 people.  
It's the %d => normal int which isn't working, which is to compile....
#include <stdio.h> int main() { unsigned long long int num and printing your unsigned long long int just fine.
Instead of 5 as it should.
I am trying to convert a unsigned char* to int * on in Objective-C on the iPhone. Is there any API that can help with the conversion? Here's my best attempt: -(BOOL)MyFunc:Version:(int *)nVer { unsigned char * uszVerSize; //trying to assign string to ...
Started by on , 3 posts by 3 people.  
Const char *asciiCString = [@"abc-zABC-Z" cString]; int.
Return [[NSNumber numberWithUnsignedChar:uszVerSize] intValue]; You a pointer to a char to a pointer to an int.
The chars to an int and return that.
I'm writing a datalog parser for a robot controller, and what's coming in from the data log is a number in the range of 0 - 65535 (which is a 16 bit unsigned integer if I'm not mistaken). I'm trying to convert that to a signed 16 bit integer to display...
Started by on , 3 posts by 3 people.  
Have you tried explicit casting? UInt16 x = 65535; var y = (Int16)x; // y = -1 how about if it's not zero, negate it and add 65534 ie 0 -> 0 65535 -> -65535 + 65534 = -1 .
Why are unsigned int's not CLS compliant. I start to think type-specification is just for performance, and not for correctness.
Started by on , 5 posts by 4 people.  
For example VB 6 had no concept of unsigned languages are being ported to the CLR why force them to implement unsigned ints to gain CLS compliance if there is absolutely....
Not all languages have the concept of unsigned ints.
I got a problem with ip2long in PHP5. It appears, that in 32bit OS ip2long returns signed int, and in 64bit OS unsigned int is returned. My application is working on 10 servers, and some are 32bit and some are 64bit, so I need all them to work same way...
Started by on , 4 posts by 4 people.  
Of ip2long into an unsigned int string by having sprintf interpret the value as unsigned with %u : $ip_int; } On a 64 bit system, printing this value ($ip_int) will display an 'unsigned' integer since with ip....
Hello I have an unsigned char * that looks (after printf) like this (it's a SHA-1 hash): n\374\363\327=\3103\231\361P'o]Db\251\360\316\203 I need to convert this unsigned char * to an unsigned int , what do you think it would be the best way to do it ...
Started by on , 4 posts by 4 people.  
However, it'd certainly-time to have the right constants, but should be enough as a proof-of-concept): unsigned int (*convert)(unsigned char *original....
That's 160 bits, so would be hard to fit in a single unsigned int.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost