kalai Posted September 17, 2011 Share Posted September 17, 2011 (setq L1 1000 L2 1000 L3 1000 L4 1000 L5 1000 ) (setq scount 10) (setq L6 120 H 6) (setq sdist (/ (- (+ L1 L2 L3 L4 L5) (+ L6 (* 2 H))) (- scount 2))) Actually the value of scount =608.5 but it is rounded to 608 How am i to get actual value? Quote Link to comment Share on other sites More sharing options...
pBe Posted September 17, 2011 Share Posted September 17, 2011 (setq sdist (/ (float (- (+ L1 L2 L3 L4 L5) (+ L6 (* 2 H)))) (- scount 2))) if you divide a whole number by a whole number you will get ====> YES a whole number Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 17, 2011 Share Posted September 17, 2011 Set the System Variable dimzin to 0 and try again . Quote Link to comment Share on other sites More sharing options...
kalai Posted September 17, 2011 Author Share Posted September 17, 2011 thanks it works Quote Link to comment Share on other sites More sharing options...
David Bethel Posted September 17, 2011 Share Posted September 17, 2011 Set the System Variable dimzin to 0 and try again . DIMZIN only affects (rtos) & (angtos) calls. Not the actual calculation. (float) is the correct way to fix a division of integer problem. -David Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 17, 2011 Share Posted September 17, 2011 DIMZIN only affects (rtos) & (angtos) calls. Not the actual calculation. (float) is the correct way to fix a division of integer problem. -David Thank you David for the clarifications . Appreciated a lot. Tharwat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.