Quantcast
Channel: CUDAfy.NET
Viewing all articles
Browse latest Browse all 1169

New Post: Problem on storing ulong

$
0
0
Trying to implement the followwing method
   [Cudafy]
    public static ulong ByteArrayToUlong(int n, byte[] array)
    {
        int i;
        ulong k = 0;
        for (i = 0; i < n; k += array[i++])
            k <<= 8;
        return k;
    }
I realised that there is a problem on storing ulong numbers. It keeps only the 32 bits e.g. 0x32877FB0A17C40 it will convert it to 0xffffffffB0A17C40.
Does anyone else face something like it ??

Viewing all articles
Browse latest Browse all 1169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>