Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.1

FloatDomainError

Raised when attempting to convert special float values (in particular Infinity or NaN) to numerical classes which don’t support them.

Example
Float::INFINITY.to_r   #=> FloatDomainError: Infinity