superceded; dicksdeathabove.xyz/~mia/psh-fractional https://dicksdeathabove.xyz/~mia/psh-fractional
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mia d04f633c63
superseded
1 month ago
refractor things seem to be working correctly most of the time; but some numbers are still broke; IE: 0.5 and 83488.99 7 months ago
tests squashed the overflow bug ,,, also made a new one ... WIP STILL... duh... 7 months ago
README superseded 1 month ago
floatm things seem to be working correctly most of the time; but some numbers are still broke; IE: 0.5 and 83488.99 7 months ago
studdy refractoring... WIP 7 months ago

README

---
# Status
-- this was simply overkill
-- will be superceded by psh-fractional
---- https://dicksdeathabove.xyz/~mia/psh-fractional
----
# Purpose
-- The purpose of this script and the pain I have endured creating it are to make bc redundant within POSIX sh
-- The one thing bc can do that POSIX sh arithmetic cannot is float math
---
# References
-- This/These script(s) make(s) use of several different lectures and outside convertors
-- See ./studdy for links to these
---
# Current status
-- Conversion algorithms are WorkInProgress's and may be inaccurate, flat out wrong
-- Or use weird shell hacks
---
# Testing
-- I know that everything is broken, and I plan to fix it
-- However; if you want to see it in action and not open a billion issues
-- Do the following
```
$ dash ./floatm '7.66'
# expected output is 0 10000001 11101010001111010111000
$ dash ./floatm '0 10000001 11101010001111010111000'
# expected output is ~7.66 - 7.65973625176
```
-- Addtionally unit tests cant be found in ./tests/
---
# Caveats
-- This is likely to be inaccurate as decimals are force shortened to 11 charecters
-- This is to prevent issues with outside shells not support numbers 23 digits long
-- Additonally I abuse this to test if the length/value of integers has "overflowed"
----
-- sh was never meant to work with floats.
-- Please, for the sake of all that is good, DO NOT USE THIS
-- This is a proof of concept, and works ionly if your lucky
-- and your sh imp actually supports numbers this big