﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37476	MinValueValidator and MaxValueValidator accept NaN	Aathithya Arasu S		"Both validators accept float NaN without raising an error:

{{{
from django.core.validators import MinValueValidator, MaxValueValidator

MinValueValidator(0)(float(""nan""))  # no error
MaxValueValidator(10)(float(""nan""))  # no error
}}}

A model FloatField with MinValueValidator(0) also passes full_clean() with NaN. This seems inconsistent with forms.FloatField, which rejects it. Is rejecting NaN in these validators the intended behavior too?

I have a patch that checks a != a before the existing comparison, with regression tests. It also changes quiet Decimal NaN from an InvalidOperation exception to a ValidationError. Valid infinity comparisons stay unchanged.

Reproduced on main (6.2.dev, commit ca3f31b) and 5.2.19."	Bug	new	Core (Other)	4.2	Low				Unreviewed	0	0	0	0	0	0
