My Arithmetic Expression Compiler, if run in a modern browser, can target both FlatAssembler and GNU Assembler. GNU Assembler doesn't support specifying float values in decimal notation, so my compiler has to convert them into the bit representation using this function:
getIEEE754 = function (decimalNumber) {
var floatArray = new Float32Array([decimalNumber]);
var buffer = floatArray.buffer;
var intArray = new Int32Array(buffer);
return (
(highlight ? '<span style="color:#007700">' : "") +
"0x" +
intArray[0].toString(16) +
(highlight ? "<\/span>" : "")
);
};
However, as Internet Explorer 6 doesn't support Float32Array and Int32Array, that function doesn't work in it. As such, when run in Internet Explorer 6, my web-app can only target Flat Assembler, which supports parsing decimal fractions into IEEE754 floats.
So, how can I make my web-app able to target GNU Assembler if it is being run in Internet Explorer 6?