Is it possible to somehow emulate single precision float in Javascript? According to Doug Crockford's blog "Number is 64-bit floating point", but I have to use single one for porting C++ algorithm which calculates single precision float's error.
From stackoverflow
-
Let me get this straight. You want to compute single precision float's mistake on a platform that has no single precision float. The trivial answer is that you can't.
The reason is you don't have the tools to accomplish such task. You've got
toFixed
andtoPrecision
methods as part of theNumber
object, but they are working with digits not bits. Actually you also have Bitwise Operators, but they convert your number toint32
first.
0 comments:
Post a Comment