DMOJ / judge-server

Judging backend server for the DMOJ online judge.
https://dmoj.ca
GNU Affero General Public License v3.0
902 stars 256 forks source link

checker improvement: make floats checker use arbitrary-precision Decimal #456

Closed xiaowuc1 closed 5 years ago

xiaowuc1 commented 5 years ago

Most floating-point checkers do not depend on this, however it can avoid issues when the precision guarantee needed is very tight.

Xyene commented 5 years ago

I feel like the "fast path" for this (10e-6?) should use regular floats for speed, and switch to Decimal when needed.

xiaowuc1 commented 5 years ago

Adding a flag that defaults to fast and uses floats in that case, and the Decimal otherwise seems like a reasonable approach.