GLBasic forum

Other languages => GLBasic - de => Topic started by: mull on 2011-Nov-19

Title: 0.1 - 0.05 = 5.e-002
Post by: mull on 2011-Nov-19
PRINT 0.1 - 0.05, 10,10
SHOWSCREEN
KEYWAIT

Ergibt 5.e-002
Warum ist das so ?
Title: Re: 0.1 - 0.05 = 5.e-002
Post by: erico on 2011-Nov-19
I get a lot of those too, I´m used to integers, calculating float is a bit too much for me.
I have seen it on results of my programs displaying variables onscreen...

I usually try PRINT FORMAT$ to round them, but some gets through.

I have also tried:
   ppx=INTEGER(j0*100.0)/100.0*10

to get rounded variables to my decimal needs.
I wish I would know what these e-thing means.

Reading joy results (-1 0 1) I get those, after rounding them, it goes ok on pc, on caanoo, the g-sensor still gives me some .e-XXX
But it is working perfectly though, that is a good sign! :P
Title: Re: 0.1 - 0.05 = 5.e-002
Post by: Kitty Hello on 2011-Nov-19
0.05 = 5e-2 = 5*10^-2
macht er so, weils kürzer ist. Format$ sollte helfen.
Title: Re: 0.1 - 0.05 = 5.e-002
Post by: mull on 2011-Nov-19
Format$ ist Ok, trotzdem blöd.