FloatCheck
Safe floating-point comparison for developers. Stop using === on floats.
API Access
Pro
$5/mo
Unlimited API calls, authentication tokens, JSON responses
- ✓ REST API with API key auth
- ✓ Epsilon & ULP comparison modes
- ✓ Batch comparison endpoint
- ✓ Priority support
FAQ
Why not use === for floats?
Floating-point arithmetic is inexact. 0.1 + 0.2 === 0.3 is false in every language. Epsilon comparison checks if two values are close enough within a tolerance.
What epsilon should I use?
For general use, 1e-9 works well. For financial calculations use a domain-specific tolerance. For scientific computing, consider relative epsilon based on the magnitude of your values.
How does the API work?
Send a POST to /api/compare with Authorization: Bearer YOUR_KEY and a JSON body with a, b, and optional epsilon. Returns equal, diff, and epsilon used.