Questions tagged [uint]

is a type of variable and is used to store the equivalent of a mathematical non-negative integer

Due to the limited amount of memory a computer can handle, uint can represent just a subset of positive integers.

In C the uint standard is unsigned int and uses 4 bytes of memory (and thus can represents all integers int the range 0 to 4,294,967,295)

192 questions
1
vote
2 answers

Why do functions take an int as an argument when its value logically can not be < 0

When I am writing functions that takes an arguments that determine a certain length, I always use uint. As it makes no sense for the value to be a negative number. But I see the opposite (very often) in the .Net framework. For example:…
Mike de Klerk
  • 11,906
  • 8
  • 54
  • 76
1
vote
1 answer

Error 1 Cannot implicitly convert type 'int' to 'uint'. An explicit conversion exists (are you missing a cast?)

I'm kinda new to C# coding and i have dealed lately with a problem and i want to ask for your help. I have this piece of code from the link below. http://pastebin.com/5jQe5tQs My problem is at the finish line: uint num = ((string_0[0] | (string_0[1]…
1
vote
1 answer

When/where/why is a size_t not a uint?

I've been getting a lot of criticism for using uint instead of size_t, but every time I check the toolchain I am working with turns out size_t is defined as a uint. Are there any compiler implementations where size_t is actually not a uint? What are…
user2341104
1
vote
2 answers

Is there a better way to represent uint8 data

I have a question regarding the representation of the uint8 data. I have a MATLAB MAT file where uint8 data are saved. The MAT file is reading into Python using scipy.io.loadmat() and a dictionary is formed. The array corresponding to the data…
Sheng2012
  • 11
  • 1
  • 2
1
vote
1 answer

Uint8 - Missing Type specifier

I'm trying to write a singleton class to hold the state of inputs from the user (mouse/keyboard data). The SDL API returns keyboard data as Uint8 pointer array, however, why I try to create the Uint8 pointer, I get these errors at the line w/ the…
Donutfiend84
  • 125
  • 2
  • 5
0
votes
1 answer

Jagged Uint8 array convert to C# byte

I have a jagged uint8 array like this in c++: UINT8 ras[2][3] = {{1,2,3},{4,5,6}} I need some way to use this as a byte array in c#. Something like byte[2][3] ras = {{1,2,3},{4,5,6}} I have a lot of uint8 arrays, so doing it manually is not an…
Casper Thule Hansen
  • 1,510
  • 2
  • 19
  • 36
0
votes
2 answers

Converting Uint16 to string in C

i'm trying to use SDL and read user input, for that I need to convert Uint16 to string, here is my code: if( event.type == SDL_KEYDOWN ) { if( strlen(str) <= 16 ) { …
user1022131
0
votes
1 answer

unable to use UnitX types, specifically, in Julia 1.9.3

Hello guys Thank you for recent help as I try to use Julia for the first time. Now, another problem: I seem to be unable to use the UintX types. I have downloaded v1.9.3 and installed it on my laptop, which is a fairly standard Win10 Pro system,…
kordes
  • 29
  • 2
0
votes
1 answer

int256_t using C++ boost library capable of showing 2^{256} - 1

I'm using the cpp_int header file from boost/multiprecision and for some reason when I cast -1 to a uint256_t then cast it back to an int256_t, it keeps the same value (~1.15e77). When I increment this variable, it wraps back to 0. What gives. Why…
amillerp
  • 11
  • 3
0
votes
0 answers

How to translate datetime in uint to python?

I am migrating some data from an old system, and an object has an attribute in the date format, but the value of the attr is a uint: | HW buy date | date | NULL 3983 | 4 | 10019 | NULL | **1639004400** The new system uses date in a string…
0
votes
1 answer

Is there uint4 standard (4 bit) array in python?

Im not expert in python. I want to seee the effect of quantization (bit depth reduction) by converting the image (array) with type of uint8 to uint4 (4 bit arrray). Is it possible an array with type of uint4 in python? I scaled my data to 0-15 and…
0
votes
1 answer

How to import type `uint` from core

I found code with implementation of b-tree in rust: https://github.com/rust-lang/rust/blob/b6edc59413f79016a1063c2ec6bc05516bc99cb6/src/libcollections/btree/map.rs where is used uint pub struct BTreeMap { root: Node, length:…
Daniel
  • 7,684
  • 7
  • 52
  • 76
0
votes
1 answer

Is it possible to get a variable (uint) of the child contract, in a parent contract? [Solidity]

I'm making a system that adds a fee to every transaction of my ERC20 token. I have two files, wiseth_v1.sol and ERC20Mod.sol written in Solidity. ERC20.sol is a modification of the ERC20.sol Openzeppelin's contract. wiseth_v1.sol first lines: //…
0
votes
1 answer

Replacement of ArrayBuffer and DataView in Flutter

I'm very new to core dart and I am having trouble in converting a piece of javascript code to dart. Please help me convert the following JS code to DART: password = "1234" value = [0x00, 0x01, 0x00, 0x00, 0x00, 0x00]; …
Siddy Hacks
  • 1,846
  • 14
  • 15
0
votes
1 answer

what is signed/unsigned integer in Solidity?

I found the following definition about signed/unsigned integers on a Solidity book from Packt: Understanding integers Integers help in storing numbers in contracts. Solidity provides the following two types of integer: • Signed integers: Signed…
mario7111
  • 61
  • 1
  • 9