[Implemented] The problem with floats persist

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] The problem with floats persist

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Fred,
See the next example

Code: Select all

OpenConsole()
a.f=15.25
b.f=15.87
c.f=a.f+b.f
PrintN(StrF(c.f,2))
Input()
I think that the solution will be in StrF, because in the actual feature don´t
rounded, it's cutted.
Rounded the decimals is the solution.

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

I don't have an answer to your problem, but I've noticed that v3.0 now halts
the debug output upon program termination, so you no longer need to use the
console to test something -- woohoo!

Example: Your code above could now be written as follows:

Code: Select all

a.f=15.25 : b.f=15.87 : c.f=a.f+b.f
Debug(StrF(c.f,2))

PB - Registered PureBasic Coder

Edited by - PB on 04 April 2002 12:22:53
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Please Fred,

I have two months waiting for 3.0 version with stoped developed.
The printer. Ok.
But... the floats not

I only make code for commercial aplications and work with EURO DECIMALS.
You have one solution for me ???
Thanks,

Manolo
Post Reply