jsperf

Inaccuracy Float Point in Computer World

This is a famous problem in computer world. It is originated from the design of CPU which uses binary as it essential unit. Let's see the problem here:

var a = 0.2 + 0.4;

console.log(a);

In most browser, we may have the value 0.600...0001. It is very anonying when we want to show a value with decimal point. We all know there are few ways to deal with this issue. We focus on two here:

1. Math.round(a * 10) / 10

2. parseFloat(a.toFixed(1))

Tags: 

The performance of Event Emitter's "fire"

 

EventEmitter vs Firefox OS's Camera evt.js

http://jsperf.com/eventemitter-vs-camera-evt-js

// updated version =>

EventEmitter vs Firefox OS's Camera evt.js vs Firefox OS's Clock emitter.js

http://jsperf.com/eventemitter-vs-camera-evt-js/2

Tags: