In creating trig functions my_sind(d), my_cosd(d), my_tand(d), that used a degree argument rather than a radian one and provided exact answers at multiples of 90, I noticed that the result was sometimes -0.0 rather than 0.0.my_sind( 0.0) -->  0.0my_sind(-0.0) --> -0.0my_sind(180.0) --> -0.0my_sind(360.0) -->  0.0sin() and tan() typically return the same sign zero result for a given sign zero input.  It makes sense that my_sin() should match sin() for those inputs. my_sind( 0.0) alike sin( 0.0) -->  0.0my_sind(-0.0) alike sin(-0.0) --> -0.0The question is: for what whole number non_zero_n should/may the result ever return -0.0 for my_sind(180*non_zero_n), my_cosd(180*n + 180), my_tand(180*non_zero_n)?It is easy enough to code so only f(-0.0) produces -0.0 and be done with it.  Simple wondering if there is any reason to make other f(x) return -0.0 for any other (non-zero) x and the importance of insuring that sign.Note: This is not a question of why 0.0 vs. -0.0 occurs.  This is not why cos(machine_pi/4) does not return 0.0.  Neither is this a question of how to control the generation of 0.0 or -0.0.  I see it best as a design question.
When should a trig function, with a degree argument, return -0.0?
c;math
The design principle of least surprise suggests that we look to previously established functionality for guidance. In this case, the closest established functionality is provided by sinpi and cospi functions introduced in IEEE Std 754-2008 (the IEEE Standard for Floating-Point Arithmetic), section 9. These functions are not part of the current ISO C and ISO C++ standards, but have been incorporated into the math libraries of various programming platforms, for example CUDA.These functions compute sin(x) and cos(x), where multiplication with  occurs implicitly inside the function. tanpi is not defined, but could, based on mathematical equivalency, be assumed to provide functionality according to tanpi(x) = sinpi(x) / cospi(x).We can now define sind(x) = sinpi(x/180), cosd(x) = cospi(x/180), tand(x) = tanpi(x/180) in an intuitive manner. Section 9.1.2 of IEEE-754 spells out the handling of special arguments for sinpi and cospi. In particular:sinPi(+n) is +0 and sinPi(n) is 0 for positive integers n. This  implies, under appropriate rounding modes, that sinPi(x) and  sinPi(x) are the same number (or both NaN) for all x. cosPi(n + ) is  +0 for any integer n when n +  is representable.The IEEE 754-2008 standard does not give a rationale for the quoted requirements, however, an early draft of the relevant section states:If the value of the function is zero, the sign of this 0 is best determined by considering the continuous extension of the sign function of the mathematical function.Perusal of the 754 Working Group Mail Archive may yield additional insights, I have not had the time to dig through it. Implementing sind(), cosd(), and tand() as described above, we then arrive at this table of example cases:SIND angle value   -540 -0  -360 -0  -180 -0     0  0   180  0   360  0   540  0COSD angle value  -630  0  -450  0  -270  0   -90  0    90  0   270  0   450  0TAND angle value  -540  0  -360 -0  -180  0     0  0   180 -0   360  0   540 -0