Page 1 of 1

About Division Decimal

Posted: Tue Feb 02, 2010 8:16 pm
by qqqnnn

Code: Select all

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

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

How to get the correct solution

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:20 pm
by Olliv
Debug 50. / 100.

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:23 pm
by qqqnnn
Olliv wrote:Debug 50. / 100.
Thank you so much thank you

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:25 pm
by qqqnnn

Code: Select all

x.i=100
y.i=50
Debug y./x.
:cry: Not run

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:29 pm
by eesau

Code: Select all

x.f=100
y.f=50

Debug y/x

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:32 pm
by qqqnnn
eesau wrote:

Code: Select all

x.f=100
y.f=50

Debug y/x
:( +Infinity

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:33 pm
by eesau
It was a typo, please try again.

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:35 pm
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?

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:42 pm
by Olliv

Code: Select all

; THE... PERFECT METHOD...

  EnableExplicit

  Define.F X, Y
  
  X = 50.
  Y = 100.
  
  Debug X / Y

Re: About Division Decimal

Posted: Tue Feb 02, 2010 8:52 pm
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????????????????????????

Re: About Division Decimal

Posted: Tue Feb 02, 2010 9:29 pm
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.

Re: About Division Decimal

Posted: Tue Feb 02, 2010 10:22 pm
by Rook Zimbabwe
isolele???

Re: About Division Decimal

Posted: Tue Feb 02, 2010 10:34 pm
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!

Re: About Division Decimal

Posted: Wed Feb 03, 2010 3:25 am
by qqqnnn
Thank you all for helping me solve the problem of the

:D Kaeru Gaman :D