Hide minor edits - Show changes to markup

April 16, 2007, at 04:54 AM
by

- Added lines 11-16:

type: any variable type (e.g. int, float, byte)

variable: any variable or constant

Changed lines 27-32 from:

type: any variable type (e.g. int, float, byte)

variable: any variable or constant

to:

When casting from a float to an int, the value is truncated not rounded. So both `(int) 3.2`

and `(int) 3.7`

are 3.

April 16, 2007, at 04:53 AM
by

- Changed lines 3-6 from:

The cast operator traslates one variable type into another and forces calculations to be performed in the cast type.

to:

The cast operator translates one variable type into another and forces calculations to be performed in the cast type.

Changed lines 13-14 from:

[@int i;

to:

[@ int i;

Changed lines 16-17 from:

f = (float)i * 10

to:

f = 3.6; i = (int) f; // now i is 3

Deleted lines 26-36:

int x; float f; f = i / 2; // f contains 0 - integer math can't hold fraction f = (float)i / 2; // f contains .5 - cast forces floating point math on right side of equation

April 16, 2007, at 04:48 AM
by

- Changed lines 9-10 from:

(variableType1)variableType2

to:

(type)variable

Changed lines 21-24 from:

variableType1: any variable type

variableType2: any variable type

to:

type: any variable type (e.g. int, float, byte)

variable: any variable or constant

April 15, 2007, at 11:35 PM
by

- Changed line 16 from:

f = (float)i

to:

f = (float)i * 10

Changed lines 31-32 from:

f = i / 2; // f contains 0 - integer math can't hold fraction f = (float)i / 2; f contains .5 - cast forces floating point math on right side of equation

to:

f = i / 2; // f contains 0 - integer math can't hold fraction f = (float)i / 2; // f contains .5 - cast forces floating point math on right side of equation

April 15, 2007, at 11:33 PM
by

- Changed lines 31-32 from:

f = i / 2; f = (float)i

to:

f = i / 2; // f contains 0 - integer math can't hold fraction f = (float)i / 2; f contains .5 - cast forces floating point math on right side of equation

April 15, 2007, at 11:30 PM
by

- Changed lines 9-10 from:

(variable type)variable

to:

(variableType1)variableType2

Changed line 13 from:

[@int x;

to:

[@int i;

Added lines 17-32:

@]

variableType1: any variable type

variableType2: any variable type

[@int x; float f;

f = i / 2; f = (float)i

April 15, 2007, at 11:27 PM
by

- Changed line 13 from:

int x;

to:

[@int x;

Added line 17:

@]

April 15, 2007, at 11:26 PM
by

- Changed lines 7-16 from:

to:

(variable type)variable

int x; float f;

f = (float)i

April 15, 2007, at 11:19 PM
by

- Changed line 7 from:

to:

April 15, 2007, at 11:19 PM
by

- Added lines 1-7:

The cast operator traslates one variable type into another and forces calculations to be performed in the cast type.