10:39 <+bridge> [ddnet] I have a variable representing money and it is a sqlite3_uint64 and the compiler yells at me when i compare it against signed integers which makes sense.. but I am not sure how to fix it. 10:40 <+bridge> [ddnet] u should tell what it yells 10:40 <+bridge> [ddnet] I was thinking about converting the normal integers to unsigned as well by creating a new variable for the comparison. 10:40 <+bridge> [ddnet] The compiler says comparision between signed and unsigned int 10:41 <+bridge> [ddnet] hm 10:41 <+bridge> [ddnet] u should decide to cast one 10:41 <+bridge> [ddnet] either the signed or the unsigned 10:41 <+bridge> [ddnet] i guess 10:42 <+bridge> [ddnet] yea 10:42 <+bridge> [ddnet] but how to cast xd 10:42 <+bridge> [ddnet] in the ifstatment? 10:42 <+bridge> [ddnet] r u in c 10:42 <+bridge> [ddnet] or c++ 10:42 <+bridge> [ddnet] c++ 10:42 <+bridge> [ddnet] tw 10:42 <+bridge> [ddnet] well 10:42 <+bridge> [ddnet] i guess u hate modern 10:42 <+bridge> [ddnet] so 10:42 <+bridge> [ddnet] xd 10:42 <+bridge> [ddnet] (int) 10:43 <+bridge> [ddnet] ya thought so 10:43 <+bridge> [ddnet] in modern i think it would be static_cast() 10:43 <+bridge> [ddnet] xd 10:43 <+bridge> [ddnet] but can that casting mess something up 10:43 <+bridge> [ddnet] well yes 10:43 <+bridge> [ddnet] i mean it is money 10:43 <+bridge> [ddnet] u should then just store money in signed 10:43 <+bridge> [ddnet] so i shouldnt fuck that up or fokko exploits the shit of mi server 10:43 <+bridge> [ddnet] if it gives u so much trouble 10:43 <+bridge> [ddnet] not like u will have max int money 10:43 <+bridge> [ddnet] or just use a long 10:44 <+bridge> [ddnet] but longs are so small 10:44 <+bridge> [ddnet] no they arent 10:44 <+bridge> [ddnet] how to fit in the money of rich ppl 10:44 <+bridge> [ddnet] +9,223,372,036,854,775,807 10:44 <+bridge> [ddnet] its not small 10:44 <+bridge> [ddnet] thats a long? 10:45 <+bridge> [ddnet] ye 10:45 <+bridge> [ddnet] that looks kinda good 10:45 <+bridge> [ddnet] https://en.wikibooks.org/wiki/C_Programming/limits.h 10:45 <+bridge> [ddnet] i thought when i looked the last time it showed a smaller number 10:45 <+bridge> [ddnet] but the thing is i thought ill be saver with unsigned since nobody should ever have negative money 10:46 <+bridge> [ddnet] if u handle ur logic correctly 10:46 <+bridge> [ddnet] then no one will have negative 10:46 <+bridge> [ddnet] and in real world is possible to have negative money btw 10:46 <+bridge> [ddnet] when u owe shit 10:46 <+bridge> [ddnet] meh i thing i switch back to long 10:46 <+bridge> [ddnet] wait or isnt the long long? or int64 10:46 <+bridge> [ddnet] wasnt that bigger 10:47 <+bridge> [ddnet] or less supportet? idk 10:47 <+bridge> [ddnet] long and long int are identical. So are long long and long long int. In both cases, the int is optional. 10:47 <+bridge> [ddnet] 10:47 <+bridge> [ddnet] As to the difference between the two sets, the C++ standard mandates minimum ranges for each, and that long long is at least as wide as long. 10:47 <+bridge> [ddnet] from stackoverflow 10:47 <+bridge> [ddnet] https://stackoverflow.com/questions/18971732/what-is-the-difference-between-long-long-long-long-int-and-long-long-i/37563374 10:48 <+bridge> [ddnet] long is a int64 10:49 <+bridge> [ddnet] Long and long int are at least 32 bits. 10:49 <+bridge> [ddnet] 10:49 <+bridge> [ddnet] long long and long long int are at least 64 bits. 10:49 <+bridge> [ddnet] but if ur compiler is 64bit long will probs be 64bit 10:49 <+bridge> [ddnet] i guess ill use int64 then xd 10:49 <+bridge> [ddnet] how it was before 10:49 <+bridge> [ddnet] ? 10:49 <+bridge> [ddnet] it has been always like this 10:50 <+bridge> [ddnet] i mean that datatype i used before 10:50 <+bridge> [ddnet] was int64 so ill go back to that 10:50 <+bridge> [ddnet] i replaced it with sqlite3_uint64 at some point uz i thought i was smart 10:50 <+bridge> [ddnet] xd 10:50 <+bridge> [ddnet] @ChillerDragon https://en.cppreference.com/w/cpp/header/cstdint 10:59 <+bridge> [ddnet] ty ryo 10:59 <+bridge> [ddnet] 10/10 search engine as always 11:11 <+bridge> [ddnet] /q 11:11 <+bridge> [ddnet] /quit 11:11 <+bridge> [ddnet] meh how to close discord xd 11:19 <+bridge> [ddnet] ctrl shift q 14:09 <+bridge> [ddnet] @Ryozuki long is 32 bit on 32 bit systems and on 64 bit windows 14:09 <+bridge> [ddnet] use explicitly sized types instead (`int64_t`) 14:09 <+bridge> [ddnet] ye thats what i said 14:09 <+bridge> [ddnet] woops 14:09 <+bridge> [ddnet] Long and long int are at least 32 bits. 14:09 <+bridge> [ddnet] 14:10 <+bridge> [ddnet] long long and long long int are at least 64 bits. 14:10 <+bridge> [ddnet] right? 14:10 <+bridge> [ddnet] in practice, that's right I think 14:12 <+bridge> [ddnet] uh, apparently it's even guaranteed by the standard 14:12 <+bridge> [ddnet] but just specify the bit width explicitly 😉 14:18 <+bridge> [ddnet] Note: as with all type specifiers, any order is permitted: `unsigned long long int` and `long int unsigned long` name the same type. 15:29 <+bridge> [ddnet] C11 adds long long int, it is guaranteed to fit 64bits 15:29 <+bridge> [ddnet] Oh already answered