Rodrigo Peres wrote:

>
> I think the problem is getting bigger :-(
>
> look this
>
> put 30*(1+(50/100))
> -- 0
>
> How can I make director calculates 50/100 for example???
>

I'm not sure how you get 0 from your put expression.

It should give you 30

The problems you are having are confusing interger math with floating point
math.

try the following

put (2/2)
--1

put (3/2)
--1

put (4/2)
--2

see what is happening, the answer gets rounded down, that is integer math

Now assuming a floatprecision of 4
put float(2)/2
--1.0000

put float(3)/2
--1.5000

put float(4)/2
--2.0000

that is floating point math. But note how the float goes around only one number
(doesn't matter which one) if you did this:
put float(3/2)
--1.0000

What happened here, we first director did integer math on the 3/2 giving 1 and
then changed that interger to a floating number

1.0000

so in your example

30*(1+(50/100))

the 50/100 would give you 0 based on integer math so you get

30*(1+0)
--30

HTH,

Rob


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to