Ruby/Number/infinite

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Содержание

Is a divide by zero finite

(-1.0/0.0).finite? # => false
(+1.0/0.0).finite? # => false



Is a divide by zero infinite

(-1.0/0.0).infinite? # => -1
(+1.0/0.0).infinite? # => 1



Is a float finite

0.0.finite? # => true



Is it infinite

0.0.infinite? # => nil