X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fmath%2Fround.c;h=d5a052b7ed3c44fc27d42f24b6b4d274956110c3;hp=bf0a321692496338d832034348477ecd9d3c2c32;hb=refs%2Ftags%2FOLD;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/math/round.c b/functions/math/round.c index bf0a321..d5a052b 100644 --- a/functions/math/round.c +++ b/functions/math/round.c @@ -1,22 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// C++ - -long long llround( float x ) { /* TODO */ }; -long long llround( long double x ) { /* TODO */ }; -long lround( float x ) { /* TODO */ }; -long lround( long double x ) { /* TODO */ }; -float round( float x ) { /* TODO */ }; -long double round( long double x ) { /* TODO */ }; - -// ---------------------------------------------------------------------------- -// Standard C +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ long long llround( double x ) { /* TODO */ }; long long llroundf( float x ) { /* TODO */ }; @@ -25,5 +12,12 @@ long lround( double x ) { /* TODO */ }; long lroundf( float x ) { /* TODO */ }; long lroundl( long double x ) { /* TODO */ }; double round( double x ) { /* TODO */ }; + +/* Therx code +{ + return (int) ( x + 0.5 ); +} +*/ + float roundf( float x ) { /* TODO */ }; long double roundl( long double x ) { /* TODO */ };