dilevin / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
2 stars 10 forks source link

rounding #65

Closed maxkmy closed 2 months ago

maxkmy commented 2 months ago

I think some rounding differences (e.g. due to differences in calculation order, data types, etc.) can cause differences in expected solution and a student's solution. I am wondering what is the "allowable range" of discrepancy for this assignment for grading purposes. Thanks!

Zhecheng-Wang commented 2 months ago

I suggest not explicitly rounding up or down during conversions. Instead, simply cast the float result to an unsigned char and assign it. As far as I know, C++ will implicitly truncate when converting float to unsigned int, which functions like rounding down but is implemented differently. (hint: the reference solution just cast and assign)

I will manually review the files, and if rounding for floats becomes an issue, I will consider how it's been handled before making any deductions.