Hey guys, what does the number in load_uint(64) actually mean? Why is it sometimes load_uint(4)? Is it a pointer to an object in the slice or just the length of the integer that needs parising?

for eg in slice~loaduint(64), what if my slice contained two uint variables?

Dec 26, 2022, 10:11 AM
It's size of integer in bits
load_uint(64) means load 64-bit unsinged integer from slice
Dec 26, 2022, 10:12 AM
But what if the slice contains 2 integers, one 32 bit and one 64 bit?
Dec 26, 2022, 10:20 AM
Generally int - 257-bit signed integers. But when we work with cells, we can write and read only significant for us part. Supposed, that you know what you have stored in the readable slice (from the TL-B scheme or from the code of contract that built this cell-slice). In this case, you need to read 2 integers a and b in same order they have written into your slice cs. For example:
int a = cs~load_uint(32);
int b = cs~load_uint(64);

You can find out some thoughts in this lessons.
Dec 26, 2022, 11:02 AM

© 2024 Draquery.com All rights reserved.