Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
deathAngel
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 24th Mar 2003 06:09
Hi, whey when I make a function the returned value is always 0? Even when I use simple function:

FUNCTION halfvalue(value)
R_value=value/2
ENDFUNCTION R_value

Is it a bug of some kind or I'm just stupid?
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 24th Mar 2003 07:33 Edited at: 24th Mar 2003 07:40
Works for me.



...that doesn't mean you're stupid by the way hehe

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 24th Mar 2003 08:45
if value is integer and value>-1 and value<1,
then the result of value/2 is 0.

integer/integer=INT(result). use value#,R_value# instead.

deathAngel
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 24th Mar 2003 09:34
Thanx guys! now it works fine.

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Mar 2003 10:59
If you want to keep integer division (by two or perhaps a power of two), try :



Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-11 08:47:08
Your offset time is: 2026-07-11 08:47:08