5 ms·
> This is cool, someone should port this to bash, which also only supports integers. With a little bitfield support (you could always call out to dc but you ca
by gumby 6y ago
> This is cool, someone should port this to bash, which also only supports integers.
With a little bitfield support (you could always call out to dc but you can do boolean arithmetic directly in bash) you can simply implement IEEE 754 in bash.
- chubot 6y agoYeah bash has 64 bit signed integers and bitwise ops on them. I'd be interested in seeing a floating point implementation. I think it would be pretty much identical to an implementation in C with signed long. echo $(( 2**63 | 1 )) -9223372036854775807