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

Allow non-integer divisors #1002

Closed
ssalbdivad opened this issue Jun 7, 2024 · 1 comment
Closed

Allow non-integer divisors #1002

ssalbdivad opened this issue Jun 7, 2024 · 1 comment
Labels
external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex)

Comments

@ssalbdivad
Copy link
Member

This would allow types like:

const interval = type("number%0.1");
@ssalbdivad ssalbdivad added the external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex) label Jun 7, 2024
@TizzySaurus
Copy link

TizzySaurus commented Jun 8, 2024

I looked into this after discussing with @ssalbdivad, and unfortunately we fall victim to floating-point errors. Things like type("number%0.1").assert("0.3") fail when they arguably shouldn't.

After bringing this up to @ssalbdivad on Discord they mentioned we should probably just not support decimal divisors since it's going to take more effort than is worthwhile to properly implement, and I think I agree.

@ssalbdivad ssalbdivad closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex)
Projects
Status: Done (merged or closed)
Development

No branches or pull requests

2 participants