guild icon
Toit
#Likelyhood of getting uint64 support? :)
Thread channel in help
addshore
addshore 02/14/2025 01:30 PM
I once again cam across implementing something that needs to deal with uint64 values, and remembered there is no toit support.
Whats the likelyhook of it being added at some stage? and or what would be the recommended best practises for working with uint64s in toit?
floitsch
floitsch 02/15/2025 12:27 PM
Typically we just use int64s. Since uint64s are normally just used as data, there isn't really a difference in treating it as signed or unsigned.
👍1
floitschfloitsch
Typically we just use int64s. Since uint64s are normally just used as data, there isn't really a difference in treating it as signed or unsigned.
addshore
addshore 02/18/2025 12:15 PM
yeah, the only annoying part is calling stringify on it for loggging and such or text display
floitsch
floitsch 02/18/2025 12:16 PM
right...
We could add a $(%X var) (where X is something unused) to print it.
Personally, I would probably always print it as hex ("$(%08x var)".
(edited)
addshore
addshore 02/18/2025 12:19 PM
so, the usecase for text display probably doesnt work with hex.
ie, our devices have a uint64 ID, and we want to display it on an eink for users to see on boot
floitsch
floitsch 02/18/2025 12:22 PM
I see. I guess an unsigned $(% is then the most useful.
👍1
floitsch
floitsch 02/25/2025 11:09 AM
Adding support for stringifying and printing integers as if they were unsigned int64s. github.com/toitlang/toi...

For example print "$(%u -1)" will print 18446744073709551615.

#Toit
Bluesky02/25/2025 11:08 AM
💟1
7 messages in total