2022-01-23 19:44:45 +00:00
|
|
|
---
|
|
|
|
psh-fractional
|
|
|
|
-- fractional math in pure sh, successor to psh-float-micro
|
|
|
|
---
|
2022-03-09 15:28:30 +00:00
|
|
|
Current Status
|
2022-04-22 18:36:58 +00:00
|
|
|
-- addition ~85% working
|
|
|
|
---- has some odd issues with decimals
|
|
|
|
---- has issues with "Illegal number"
|
|
|
|
------ eg: 18471.81672 + 27540.27237
|
|
|
|
---- will debug at later date
|
2022-04-05 16:24:44 +00:00
|
|
|
-- subtraction ~90% working
|
2022-04-22 18:36:58 +00:00
|
|
|
---- had issues due to an edge case before: see last commit
|
|
|
|
---- has an issue where $e in rad() somehow becomes malformed
|
|
|
|
------ eg: 23019.18605 - 1139
|
|
|
|
------ produces: 11629.18605
|
|
|
|
------ correct: 21880.18605
|
|
|
|
---- current method uses a system of removing the decimal from $1 & $2
|
|
|
|
---- and then subtracting them; (m1-m2)
|
|
|
|
---- the issue is likely in rad() as $((m1-m2)) is correct before
|
|
|
|
---- being handed to rad()
|
2022-04-05 16:24:44 +00:00
|
|
|
-- multiplication 100% working
|
2022-04-22 18:36:58 +00:00
|
|
|
---- length issues when comparing to bc (produces additional decimals)
|
|
|
|
------ I am not going to attempt to fix this
|
|
|
|
------ it's really not an issue
|
2022-04-05 16:24:44 +00:00
|
|
|
-- division ~90% working
|
|
|
|
---- may sometimes produce to many decimals
|
2022-04-22 18:36:58 +00:00
|
|
|
------ this will not be fixed
|
2022-04-05 16:24:44 +00:00
|
|
|
---- rarely places decimals in wrong places
|
2022-04-22 18:36:58 +00:00
|
|
|
------ eg: 324.81478 / 21715
|
|
|
|
------ produces: 1.49580833525212986414
|
|
|
|
------ correct: 0.01495808335252129864
|
|
|
|
---- Some odd edge case with $dp is causing this...
|
|
|
|
---- debugging ongoing
|
2022-03-09 15:28:30 +00:00
|
|
|
---
|
2022-04-16 05:47:36 +00:00
|
|
|
Outer Usage
|
2022-04-22 18:36:58 +00:00
|
|
|
-- it is recommended to use this library with psh-fc
|
|
|
|
-- if you wish to compare numbers that it produces
|
2022-04-16 05:47:36 +00:00
|
|
|
-- as decimal numbers are not considered numbers by posix sh
|
|
|
|
---- https://dicksdeathabove.xyz/~mia/psh-fc
|
|
|
|
---
|
2022-03-09 15:28:30 +00:00
|
|
|
Tester
|
|
|
|
-- a tester is present at ./tester; it is ofc not pure sh as it compares with bc
|
|
|
|
-- additionally using it requires that $RPATH is set to ?/psh-prng/ran
|
2022-01-23 19:44:45 +00:00
|
|
|
---
|