Closed
Description
By replacing the exponent
field in the Number
struct with two fields, one for an enum representing the different possible values and another for if the exponent is negative, you can remove the unsafe in float.rs
:
unsafe { *TABLE.get_unchecked(exponent)}
can be replaced with
TABLE[exponent as usize]
with little to no speed change over the unsafe counterpart. In my (quite limited) testing, the unsafe code actually performed slower because of the dereference.
Metadata
Metadata
Assignees
Labels
No labels