int versus float

Benchmark created on


Setup

var intA = 65536;
    var intB = 2;
    var floatA = 65000.251;
    var floatB = 1.987;
    
    var c;
    var d;
    var i;

Teardown


    c = intA;
    d = floatA;
  

Test runner

Ready to run.

Testing in
TestOps/sec
int add
for(i=0; i<16; ++i) {
  c += intB;
}
ready
float add
for(i=0; i<15; ++i) {
  d += floatB;
}
ready
int multiply
for(i=0; i<15; ++i) {
  c *= intB;
}
ready
float multiply
for(i=0; i<15; ++i) {
   d *= floatB;
}
ready
int divide
for(i=0; i<15; ++i) {
  c /= intB;
}
ready
float divide
for(i=0; i<15; ++i) {
  d /= floatB;
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.