# Integer(nil) and checking numericality

**URL:** <https://www.ruby-forum.com/t/integer-nil-and-checking-numericality/79357>\
**Category:** Ruby\
**Created:** [March 10, 2006, 4:20am UTC](https://www.ruby-forum.com/t/integer-nil-and-checking-numericality/79357 "2006-03-10T04:20:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [March 10, 2006, 4:20am UTC](https://www.ruby-forum.com/t/integer-nil-and-checking-numericality/79357/1 "2006-03-10T04:20:05Z")

</div>

Why does Integer(nil) return 0? Isn’t the point of Integer to assert  
that the arg is actually an integer? (If we just want a best guess, we  
can do ‘323aaadsfwefsd’.to\_i or ‘’.to\_i )/
