About Division Decimal

Just starting out? Need help? Post your questions and find answers here.
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

About Division Decimal

Post by qqqnnn »

Code: Select all

debug 50/100
Correct result = 50/100 = 0.5

purebasic 50/100 = 0 ???????

How to get the correct solution
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: About Division Decimal

Post by Olliv »

Debug 50. / 100.
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

Olliv wrote:Debug 50. / 100.
Thank you so much thank you
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

Code: Select all

x.i=100
y.i=50
Debug y./x.
:cry: Not run
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: About Division Decimal

Post by eesau »

Code: Select all

x.f=100
y.f=50

Debug y/x
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

eesau wrote:

Code: Select all

x.f=100
y.f=50

Debug y/x
:( +Infinity
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: About Division Decimal

Post by eesau »

It was a typo, please try again.
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

eesau wrote:It was a typo, please try again.

Code: Select all

x.f=100
y.f=50
Debug y/x
Such an error?
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: About Division Decimal

Post by Olliv »

Code: Select all

; THE... PERFECT METHOD...

  EnableExplicit

  Define.F X, Y
  
  X = 50.
  Y = 100.
  
  Debug X / Y
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

Code: Select all

LoadImage(0,Image)
Debug ImageHeight(0) /ImageWidth(0) 

Image width=100px
Image height=50px

:( Debug ImageHeight(0) /ImageWidth(0) =0????????????????????????
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: About Division Decimal

Post by Kaeru Gaman »

please THINK

Code: Select all

LoadImage(0,Image)
y.f = ImageHeight(0)
x.f = ImageWidth(0)
a.f = y/x 
debug a
ImageHeight and ImageWidth return integers, not floats.
oh... and have a nice day.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: About Division Decimal

Post by Rook Zimbabwe »

isolele???
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: About Division Decimal

Post by Olliv »

What I think, it's that I will need many weeks to translate,
analyze, understand and give a rational conclusion about the question of Rook Zimbabwe!
qqqnnn
User
User
Posts: 22
Joined: Mon Jan 11, 2010 7:45 pm

Re: About Division Decimal

Post by qqqnnn »

Thank you all for helping me solve the problem of the

:D Kaeru Gaman :D
Post Reply