Re: Conversion of Real to Integer
- Subject: [mg3062] Re: Conversion of Real to Integer
- From: ianc (Ian Collier)
- Date: 30 Jan 1996 04:40:20 -0600
- Approved: usenet@wri.com
- Distribution: local
- Newsgroups: wri.mathgroup
- Organization: Wolfram Research, Inc.
- Sender: daemon at wri.com
In article <4efb89$rp7 at dragonfly.wri.com>, TTCJ34A at prodigy.com (DR JOHN C ERB) wrote: > In mathematica, how can one emulate the fortran real to integer > conversion functions INT ( ) and > NINT ()? An example being: INT(3.6) --> 3 and NINT(3.6) --> 4. Also, > how does one convert from integer to real? Thank you. Hello, The functions you want are: Floor, Ceiling and N. In[1]:= Floor[ 3.6 ] Out[1]= 3 In[2]:= Ceiling[ 3.6 ] Out[2]= 4 In[3]:= N[3 ] Out[3]= 3. I hope this helps. --ian ----------------------------------------------------------- Ian Collier Technical Sales Support Wolfram Research, Inc. ----------------------------------------------------------- tel:(217)-398-0700 fax:(217)-398-0747 ianc at wri.com Wolfram Research Home Page: http://www.wri.com/ -----------------------------------------------------------