You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the code between r32 and r64 is pretty much the same (as a result of copy-pasting it) except for some modifications to handle larger numbers in r64. Ideally tho, there should be a macro that handles implementations for both types in order to reduce code reuse and possible inconsistencies between them.
Such a macro should only rely on:
the name of the type (given to the macro)
some constants defined specifically for each type:
TOTAL_SIZE – gives the total number of bits of the internal type; e.g. for r32, it's 32 bits (note: not currently defined in code)
FRACTION_SIZE – gives the size of the fraction field
Everything else (including other necessary constants) should be derivable from the ones above.
The text was updated successfully, but these errors were encountered:
Tried out using macros to reduce some boilerplate recently. They helped reduce test code and trait implementations, but when using them for inherit methods they messed the documentation up a bit too much for my liking, so I copied the inherit methods back to each type for now. So far this way of doing things works well enough, although the tests macro should be modified slightly to allow for tests that can only be done by certain types.
Right now the code between
r32
andr64
is pretty much the same (as a result of copy-pasting it) except for some modifications to handle larger numbers inr64
. Ideally tho, there should be a macro that handles implementations for both types in order to reduce code reuse and possible inconsistencies between them.Such a macro should only rely on:
TOTAL_SIZE
– gives the total number of bits of the internal type; e.g. forr32
, it's 32 bits (note: not currently defined in code)FRACTION_SIZE
– gives the size of the fraction fieldEverything else (including other necessary constants) should be derivable from the ones above.
The text was updated successfully, but these errors were encountered: