Closed DerTee closed 8 months ago
I've generally found issues with `math/fixed`. Specifically the procedure `math/fixed.init_from_parts` does compile after deleting the line I've mentioned in the original description, but it still produces incorrect results while `math/fixed.init_from_f64` works as expected. I'll update the issue description when I've found a solution and I'll also adhere to the standard template the I've accidently circumvented by creating the issue by clicking "new issue" from the github interface while reading the code, sorry. Is it alright if I create a PR and tests for that?
A PR with that is very welcome!
@Kelimion was nice enough to take a look and agreed, that it is not obvious how init_from_parts
should work and that this proc should probably be scrapped and re-evaluated.
When using
math/fixed.init_from_parts
I get this error:The fix is simple: The offending line is superfluous and can be deleted because the integer and fractional parts are given directly via parameters. Probably a copy paste error from the related function
init_from_f64
.https://github.com/odin-lang/Odin/blob/d2e1ec13f0debae251b2b971bcb7f273f41374f5/core/math/fixed/fixed.odin#L42