Which is the first integer that an IEEE 754 float is incapable of representing exactly?

For clarity, if I’m using a language that implements IEE 754 floats and I declare: float f0 = 0.f; float f1 = 1.f; …and then print them back out, I’ll get 0.0000 and 1.0000 – exactly. But IEEE 754 isn’t capable of representing all the numbers along the real line. Close to zero, the ‘gaps’ … Read more

Defining TypeScript callback type

I’ve got the following class in TypeScript: class CallbackTest { public myCallback; public doWork(): void { //doing some work… this.myCallback(); //calling callback } } I am using the class like this: var test = new CallbackTest(); test.myCallback = () => alert(“done”); test.doWork(); The code works, so it displays a messagebox as expected. My question is: … Read more