MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Conversion of Real to Integer


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/
-----------------------------------------------------------

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Performance of Ma with Win95
  • Next by Date: is this integration possible with mathematica?
  • Previous by thread: Re: Conversion of Real to Integer
  • Next by thread: Re: Conversion of Real to Integer