2 Remove typo and add spaces
source | link

You can use float and double literals to save a few bytes.

var x=2.0;
var y=2d;         // saves 1 byte

When you need some int arithmetic to return a float or double you can use the literals to force the conversion.

((float)a+b)/2;  // this is no good
(a+b)/2.0;       // better
(a+b)/2f;        // best      

If you ever run into a situation where you have to to cast you can save a few bytes by using multiplication instead.

((double)x-y)/(x*y);
(x*1Dx*1d-y)/(x*y);      // saves 5 bytes

You can use float and double literals to save a few bytes.

var x=2.0;
var y=2d;         //saves 1 byte

When you need some int arithmetic to return a float or double you can use the literals to force the conversion.

((float)a+b)/2;  //this is no good
(a+b)/2.0;       //better
(a+b)/2f;        //best      

If you ever run into a situation where you have to to cast you can save a few bytes by using multiplication instead.

((double)x-y)/(x*y);
(x*1D-y)/(x*y);      //saves 5 bytes

You can use float and double literals to save a few bytes.

var x=2.0;
var y=2d;         // saves 1 byte

When you need some int arithmetic to return a float or double you can use the literals to force the conversion.

((float)a+b)/2;  // this is no good
(a+b)/2.0;       // better
(a+b)/2f;        // best      

If you ever run into a situation where you have to to cast you can save a few bytes by using multiplication instead.

((double)x-y)/(x*y);
(x*1d-y)/(x*y);      // saves 5 bytes
1
source | link

You can use float and double literals to save a few bytes.

var x=2.0;
var y=2d;         //saves 1 byte

When you need some int arithmetic to return a float or double you can use the literals to force the conversion.

((float)a+b)/2;  //this is no good
(a+b)/2.0;       //better
(a+b)/2f;        //best      

If you ever run into a situation where you have to to cast you can save a few bytes by using multiplication instead.

((double)x-y)/(x*y);
(x*1D-y)/(x*y);      //saves 5 bytes