I have just installed gcc 2.7.2 and libg++ 2.7.1 on my Sun SPARC system,
under Solaris 2.5.
Our programmers are used to the C and C++ that came with SunOS. Now that
I'm migrating to Solaris I've installed gcc and g++ for them to try out
Some of their programs called a function called 'nint' in math.h. This
converted a value into int format, rounding to the nearest int value
(here's an extract from the man page which explains it better than I can!
:
nint() converts x into int format rounding to the nearest
int value, except halfway cases are rounded to the int value
larger in magnitude. This corresponds to the Fortran gen-
eric intrinsic function nint().
However, the 'nint' function does not seem to exist in the gcc math.h. Is
there an equivalent they should be using? Or should we be using a
different header file??
(Please excuse my ignorance, It's been a long time since I did any
programming and I'm new to gcc and g++ !)
Can anyone please help!
Thanks in advance,
Tim
--
-------------------------------------------------------------------
Tim Porter t.po...@fcrd.gov.uk
Forestry Commission, Research Division
-------------------------------------------------------------------
In article <4rqlb5$6...@jupiter.fcrd.gov.uk>, por...@fcrd.gov.uk (Tim Porter) writes:
>I have just installed gcc 2.7.2 and libg++ 2.7.1 on my Sun SPARC system,
>under Solaris 2.5.
...
>However, the 'nint' function does not seem to exist in the gcc math.h. Is
>there an equivalent they should be using? Or should we be using a
>different header file??
>
>
> Tim
try "man nint" to see what file needs to be included, and what libraries
specified..
on my solaris system, i #include <sunmath.h> and compile with
cc foo.c -lsunmath -lm
andy