// This code is Public Domain. Use, modify, and redistribute at will.
// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-// C++
+double copysign( double x, double y ) { /* TODO */ };
-float copysign( float x, float y ) { /* TODO */ };
-long double copysign( long double x, long double y ) { /* TODO */ };
+/* Own code
+{
+ if ( y < 0 )
+ {
+ return ( x < 0 ) ? x : -x;
+ }
+ else
+ {
+ return ( x < 0 ) ? -x : x;
+ }
+}
-// ----------------------------------------------------------------------------
-// Standard C
-
-double copysign( double x, double y ) { /* TODO */ };
float copysignf( float x, float y ) { /* TODO */ };
long double copysignl( long double x, long double y ) { /* TODO */ };