Quite frankly, when situations such as these happen to arise, I say:
"Why are you still trying to use 'bash scripts,' when in fact you do not have to?"
Truth is, "the entire
world is Your Oyster." Simply add a
"shebang" #!commandprocessor line at the top of your script, and the shell will hand-off further processing of your script to whatever
commandprocessor you name. You are
not constrained by the built-in macro capabilities of your chosen shell.
Generally speaking, the only way to compare floating-point values for "equality" is to decide that the absolute-value of their difference is below some certain acceptable-to-you threshold. And so,
even though this sort of thing might be a bit beyond the design-limits of your shell-author's imagination
, you need not be concerned. Simply code the thing in "the language of your choice." Linux, after all, provides you with oh-so-many choices . . . and
"shebang" #!commandprocessor puts
all of them at your feet.
"The end-user will
never know ..." (Or care.)