dividing 1 with 100 is 0 why?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2012   #1
dividing 1 with 100 is 0 why?

I have strange behaviour with maxcsript, when i want divide 1/100 he says that it is 0 do you know whre is the problem?
 
Old 02 February 2012   #2
Because you devide integer with integer.

Try 1.0/100
 
Old 02 February 2012   #3
Because you're using integers so your result will be an integer. Make one of your numbers a float and it will return a float.

Code:
1/100 0 1 as float/100 0.01 1/100 as float 0.01
__________________
| Twitter | LinkedIn | JCanimator.com |
 
Old 02 February 2012   #4
thanks a lot guys
 
Old 02 February 2012   #5
That can be an easy thing to forget about.
gotta watch out for the float/integer calculations.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 02 February 2012   #6
That can be an easy thing to forget about.
gotta watch out for the float/integer calculations.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 02 February 2012   #7
That can be an easy thing to forget about.
gotta watch out for the float/integer calculations.
__________________
____________ ___ __ _
John A. Martini
JokerMartini@hotmail.com
www.JokerMartini.com
 
Old 02 February 2012   #8
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:09 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.