bash-3.2$ echo $((1.5+0.5))
bash: 1.5+0.5: syntax error: invalid arithmetic operator (error token is ".5+0.5")
https://unix.stackexchange.com/questions/40786/how-to-do-int...I gave up INTEGER BASIC for APPLESOFT several decades ago, and never looked back.
(LOADING INTEGER INTO LANGUAGE CARD)
]INT
>PRINT 1.5 + 0.5
*** SYNTAX ERROR
>FP
]PRINT 1.5 + 0.5
2
It's 2019, and you're struggling to do in bash what you could have done on an Apple ][ in 1979, but the syntax you need to use is even WORSE than BASIC, so your code looks like line noise from when your mom picks up the phone while you're using a 300 baud modem. Is that really progress?https://en.wikipedia.org/wiki/Integer_BASIC
>Integer BASIC was phased out in favor of Applesoft BASIC starting with the Apple II Plus in 1979. This was a licensed but modified version of Microsoft BASIC, which included the floating point support missing in Integer BASIC.
https://en.wikipedia.org/wiki/Applesoft_BASIC
>Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original Apple II model. It is also referred to as FP BASIC (from "floating point") because of the Apple DOS command used to invoke it, instead of INT for Integer BASIC.
Notice that there are even machine language instructions for cos, atan, tan, sin, ln, etc. How do you call those instructions in bash?
https://docs.oracle.com/cd/E18752_01/html/817-5477/eoizy.htm...
>x86 Assembly Language Reference Manual: Floating-Point Instructions
>The floating point instructions operate on floating-point, integer, and binary coded decimal (BCD) operands.