Skip to main content

Timeline for Calculating sum of squares in C

Current License: CC BY-SA 3.0

4 events
when toggle format what by license comment
Aug 30, 2017 at 7:52 comment added Toby Speight You're right, @chux - I just threw in something to make the point that checking for errors is a good thing. I've now changed it so that it sets errno appropriately (though, unlike library functions, it clears errno on success - that's an arguable choice). If zero is returned, we can still distinguish between sum_squares_to(0) and sum_squares_to(ULONG_MAX).
Aug 30, 2017 at 7:50 history edited Toby Speight CC BY-SA 3.0
Make the error checking less rudimentary
Aug 29, 2017 at 17:15 comment added chux Nice c <= n for detecting OF in b,c. Yet since 0 is a proper response to sum_squares_to(0), perhaps consider an alteration value or approach to signal OF?
Aug 29, 2017 at 15:08 history answered Toby Speight CC BY-SA 3.0