Questions tagged [ulong]

65 questions
0
votes
0 answers

Converting/Casting List to List

I've been trying to cast List property to List property. It seems no matter what I do, it keeps failing to get or set data. public List _DocumentIds { get; set; } = new List(); Things I've tried to convert…
user8015938
0
votes
1 answer

Can someone Explain why a number higher and lower will calculate but my actual number wont?

So, this console app just prints if a number is prime or not, works great for almost every number, but when the assignment is asked to time test the function with two hardcoded numbers (7389274937501454911 and 9389274937501454911) these numbers will…
0
votes
3 answers

Get total installed RAM in C# on Windows 10

I am making a piece of software which displays some hardware information, along with other pieces of info. My Problem is: I use this piece of code, method found in another thread: https://stackoverflow.com/a/15790751/5782981 public ulong…
Kristian
  • 125
  • 2
  • 17
0
votes
1 answer

ulong, bitmask and bit shift in PHP from C#

Ok so my problem is that I've to "process" a big integer from an endpoint response. This is a hash and I've to do some bit mask and bit shifts in order to view this data (it's a version: major, minor, build, etc) in a human readable way. In C# I've…
fratili
  • 31
  • 5
0
votes
0 answers

c# to Javascript conversion - Requires ulong (unsigned 64 bit)

NOTE: I need to do bitwise masking on the 64 bit integer. I am converting some c# to javascript. Within it is a ulong; a unsigned 64 bit c# integer. The 64 bit integer is in a text based ascii file, which needs to be loaded into the javascript and…
Rewind
  • 2,554
  • 3
  • 30
  • 56
0
votes
1 answer

add two unsigned value in C and C#

I have a calculation in c that I should write it in c# this is my code in c: const unsigned long *S //which is an array that already contains data ) unsigned long y; y = y + S[d]; //S[d] = 2582066069 and y = 3372499074 and the results is…
lol
  • 93
  • 3
  • 11
0
votes
1 answer

Numeric value of ULong.MaxValue is considered an overflow in Visual Basic.NET

In Visual Basic.NET ULong.MaxValue=18,446,744,073,709,551,615. The following code runs fine: Dim a As ULong = ULong.MaxValue The following code returns an overflow error on the number Dim b As ULong = 18446744073709551615 What is causing this…
Eric Johnson
  • 205
  • 2
  • 14
0
votes
1 answer

ulong to hex conversion clarification

I have a reference program which I got online. In that variable data64 is defined as ulong type. Which they're converting to unicode and displaying in a textbox like this: TextBox1.AppendText = Rxmsg.data64.ToString("X"); The actual value of data64…
Vasanth
  • 43
  • 1
  • 11
0
votes
2 answers

C# uint64 -- Store data?

Is there a better way to store numerical data in an uint64 other than using x digits for one piece, y digits for other stuff? (20 digits total to work with) I am trying to store information about an object without having the overhead of making a…
Chris G
  • 57
  • 9
0
votes
1 answer

Wrapping ulong variables with arithmatic operators

I'm somewhat confused regarding the nature of intentionally overflowing structures like ulong in C#. Essentially I'm working on a grid that I want to be ulong.max X ulong.max squares. If I perform an arithmetic operation on the coordinates I want…
ThisHandleNotInUse
  • 1,135
  • 1
  • 10
  • 23
0
votes
3 answers

Operator '&' cannot be applied to operands of type 'ulong' and 'ulong*'

Operator '&' cannot be applied to operands of type 'ulong' and 'ulong*' What am I doing wrong? I'm trying to find which masks a integer consists of, if that makes sense. e.g. 63 = 1+2+4+8+16+32 unsafe { UInt64 n =…
user3685954
  • 35
  • 1
  • 7
0
votes
2 answers

Cannot implicitly convert type 'long' to 'ulong'. (+random ulong)

I've been declaring a class with a ulong parameter, but when I want ot assign it in the constructor, the program tells me, thata something is wrong, but I don't understand what is. It is a ulong type, I don't want him to convert anything. public…
Orodshsen
  • 5
  • 2
0
votes
4 answers

How to get amount of 1s from 64 bit number

Possible duplicate: Count number of bits in a 64-bit (long, big) integer? For an image comparison algorithm I get a 64bit number as result. The amount of 1s in the number (ulong) (101011011100...) tells me how similar two images are, so I need…
Thomas
  • 4,030
  • 4
  • 40
  • 79
-1
votes
3 answers

How to convert Ulong to Lptstr in C

I have an ulong value, how can i convert it to LPTSTR? I need to get LPTSTR value. (no printf) Example code: ULONG value = 1; LPTSTR valueString = ??? Thanks!
Kracken
  • 662
  • 1
  • 11
  • 27
-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