Wrong value when increasing float (SOLVED)

Started by Rocco, Sun 05/02/2006 22:09:16

Previous topic - Next topic

Rocco

unfortunatly, i guess i encounter a bug,
who makes my intention much more difficult.

example code:
Code: ags

float test = 0.0;
player.Say("Value before %d", test);
test += 0.1;
player.Say("Value after %d", test);


this generates values like 1038457954

Kweepa

%d is used to print ints.
Use %f to print floats.
The first print statement works because 0 int is the same internal representation as 0 float.
Still waiting for Purity of the Surf II

Rocco

ohh ok, sorry.
this means the strange behavior is in my script (and not in the floats).
thxÃ,  :)

SMF spam blocked by CleanTalk