[MITgcm-devel] testreports broken on SunOS
chris hill
cnh at mit.edu
Mon Jan 31 09:48:52 EST 2005
The way to do this portably in C is to create a function called nint()
that uses a combination of ceil() and floor()!
Chris
Jean-Michel Campin wrote:
> Hi Martin,
>
> we had before INT(log10(relerr)) (I write it in fortran, so that
> I know what I am talking about) and I though it would be better
> to truncate to the nearest integer, and to do: NINT(log10(relerr)).
> The reason is that even with 15 digits of matching, the INT(log10(relerr))
> often return 14, whereas NINT(log10(relerr)) give a closer estimation of
> the accuracy (in number of digits).
>
> So, it seems that it's hard to find a simple c program that
> will work on any platform and will just do the same thing as "NINT"
> in fortran. Ed, what is your opinion ?
>
> Jean-Michel
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://dev.mitgcm.org/mailman/listinfo/mitgcm-devel
>
More information about the MITgcm-devel
mailing list