From: Michael Purdy on 27 May 2010 13:54 Is there any way to drop the numbers after a decimal? For example if I have 2.9 I want to drop the .9 and get an answer of 2. So far I have only been able to find how to round up, but I need to be able to round down. Thanks very much, Michael
From: Walter Roberson on 27 May 2010 14:00 Michael Purdy wrote: > Is there any way to drop the numbers after a decimal? For example if I > have 2.9 I want to drop the .9 and get an answer of 2. So far I have > only been able to find how to round up, but I need to be able to round > down. Round to negative is floor() and round to 0 is fix().
From: Matt J on 27 May 2010 14:03 "Michael Purdy" <misterman90(a)hotmail.com> wrote in message <htmbju$pql$1(a)fred.mathworks.com>... > Is there any way to drop the numbers after a decimal? For example if I have 2.9 I want to drop the .9 and get an answer of 2. So far I have only been able to find how to round up, but I need to be able to round down. > Thanks very much, ======== help floor But if you already are using ceil() to round up, I'm not sure why you wouldn't know about floor() as well
From: David Young on 27 May 2010 14:03 Try the floor function.
From: Michael Purdy on 27 May 2010 14:28 Walter Roberson <roberson(a)hushmail.com> wrote in message <8ryLn.53011$304.24860(a)newsfe12.iad>... > Michael Purdy wrote: > > Is there any way to drop the numbers after a decimal? For example if I > > have 2.9 I want to drop the .9 and get an answer of 2. So far I have > > only been able to find how to round up, but I need to be able to round > > down. > > Round to negative is floor() and round to 0 is fix(). Thanks for your help.
|
Pages: 1 Prev: integer programming with matlab Next: integer programming with matlab |