Modifying of Debug [Ceased]

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Modifying of Debug [Ceased]

Post by Lubos »

I tried to use Debug command for instant express calculation.
It works fine even for relatively complicated expression. If express contains integer number only, the result is integer too. A float number must stand as first. I can solve it by multiplying by 1.0, but I don’t like it. Instant calculation is useful, so I suggest modify behavior of Debug.

Code: Select all

Debug 5/2 + 1/3
Debug 5/2 +  1/3*1.0
Debug 5/2  + 1.0 *(1/3)
Debug (5/2  + 1/3)*1.0 
Debug 1.0* (5/2  + 1/3)
Debug (5/2+5/2+5/2+5/2)*1.0
Debug 1.0*(5/2+5/2+5/2+5/2)
Debug 1.0*5/2 + (5/2+5/2+5/2)
Debug -5/3 + Log(2) 
Debug  Log(2) - 5/3
Last edited by Lubos on Wed Oct 22, 2008 7:46 pm, edited 1 time in total.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

don't get it....
you want to be the result of a debug be FLOAT in every case, even when you enter only Integers?
oh... and have a nice day.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

No need to multiply by 1.0, just need to add '.' after, like that:

Code: Select all

Debug 5./2. + 1./3.
:)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Post by Lubos »

Kaeru Gaman wrote:don't get it....
you want to be the result of a debug be FLOAT in every case, even when you enter only Integers?
Yes. But, it was already only suggestion. Maybe, permanent float brings other disadvantages. Probably better sugestion is Debug.f
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Post by Lubos »

Psychophanta wrote:No need to multiply by 1.0, just need to add '.' after, like that:

Code: Select all

Debug 5./2. + 1./3.
:)
Oh. So simple. :shock: I drive my sugggestion back. I was a rash.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Maybe, permanent float brings other disadvantages.
it surely does. Float has an incertaincy.

If I want to debug my code, I need to see the integer values that resulted as Integers.

being able to execute instant calculations is just a kind of "bonus".

ever thought about using CALC.EXE?
windows HAS a build-in calculator, you know?
oh... and have a nice day.
Post Reply