Fixed point numbers library
Adding fixed point numbers library akin to https://github.com/abdk-consulting/abdk-libraries-solidity
Adding basic math functionality to other connected types i.e. u8/16/32/64/128
@rostyslavtyshko can you clarify what was happening that was causing the related bug on this PR?
@rostyslavtyshko can you clarify what was happening that was causing the related bug on this PR?
Compiling Sway and the library works as expected however when you attempt to import the U128 type (for testing) and use the Expo trait with the pow() function it would complain that pow() does not exist no matter how it was imported and where it was located.
E.g. some_u128_var.pow() with the error that pow() is not found on the type.
The strange thing is that other traits defined within the same file, or other files, for the U128 have been discovered and worked as expected. The expo trait seemed to not exist within tests at all despite the library itself compiling as expected.
Sorry, got ahead of myself and edited your comment by accident
As discussed previously, it's better to move this PR to the sway-libs repository. Once https://github.com/FuelLabs/sway/issues/2873 is resolved, we can bring back all the math libraries into sway-lib-std.
Changing this to a draft in the meantime.
I'm going to close this in favor of https://github.com/FuelLabs/sway-libs/pull/32 and https://github.com/FuelLabs/sway-libs/pull/31.