Floats require a 0.?

Advanced game related topics
Krylar
User
User
Posts: 88
Joined: Thu Apr 15, 2004 3:17 pm

Floats require a 0.?

Post by Krylar »

Hiya,

Noticed something odd, but maybe it's just not what I'm used to. If I try to add .5 to something I get an error. However, if I try to add 0.5 it works okay.

Example:

Code: Select all

  Value.f = Random(1) + .5
That will bomb in the compiler, but:

Code: Select all

  Value.f = Random(1) + 0.5
...seems to work just fine.

So the 0. has to be there, it seems...or am I doing something wrong?

Thanks!

-Krylar
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

You're right, seems Fred has to fix this as soon he's back from holiday.

My calculator accepts this without problems:

.1 [=}

0.1 appears on the display. :wink:
The truth is never confined to a single number - especially scientific truth!
ivory
User
User
Posts: 36
Joined: Fri Jun 25, 2004 2:30 am

Post by ivory »

This has been reported already. Apparently, there are only a few of us who enter decimal fractions without the leading zero, (so it was by design not by oversight), however, I got the feeling that Fred would add this in, time permitting.
Post Reply