Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix warning (trailing zeros added) #287

Closed
dtowell opened this issue Mar 7, 2025 · 2 comments
Closed

How to fix warning (trailing zeros added) #287

dtowell opened this issue Mar 7, 2025 · 2 comments

Comments

@dtowell
Copy link

dtowell commented Mar 7, 2025

I got the following warning:
No validator rejects trailing zeros added to real number decimal portion

I am using CTD to validate:
FLOAT(0,10^9)

It feels like this should be fine, and I don't know what the recommended method to "fix" the warning. I could change to REGEX() but that begs the question as to the value of FLOAT().

Any hints would be appreciated.

@ghamerly
Copy link
Contributor

ghamerly commented Mar 8, 2025

I recommend using the CTD feature FLOATP rather than FLOAT, because FLOATP allows you to specify the maximum number of digits after the decimal point. It's generally a good idea (IMO) to specify the maximum precision for a problem (and give this information in the problem as well). See for example the input specification for https://open.kattis.com/problems/dartscoring

@dtowell
Copy link
Author

dtowell commented Mar 9, 2025

Thank you. That is great.

@dtowell dtowell closed this as completed Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants