From 16aeaa50db79e3c17194128a93d22370bf5daa33 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Tue, 19 Mar 2024 23:07:54 -0400 Subject: markov: avoid float division in uint_to_bytes It seems as though the float division could cause an issue where the actual value should be an integer but the float representation is slightly higher than that, causing the addition of an extra unnecessary byte. Although this works fine as long as the same function is used, it could cause problems if seemingly inconsequential details change. I switch to using divmod and checking for the presence of a remainder. This should ensure use of the exact minimum required number of bytes in the blob. --- starboard/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 starboard/__init__.py (limited to 'starboard/__init__.py') diff --git a/starboard/__init__.py b/starboard/__init__.py new file mode 100644 index 0000000..eeb3d75 --- /dev/null +++ b/starboard/__init__.py @@ -0,0 +1,5 @@ +from .starboard import Starboard + + +async def setup(bot): + await bot.add_cog(Starboard(bot)) -- cgit v1.2.3-57-g22cb