# Analogue of zero(T) for infinitiy

**URL:** https://discourse.julialang.org/t/analogue-of-zero-t-for-infinitiy/7027
**Category:** General Usage
**Tags:** question
**Created:** [November 12, 2017, 5:40pm UTC](https://discourse.julialang.org/t/analogue-of-zero-t-for-infinitiy/7027 "2017-11-12T17:40:56Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [November 12, 2017, 8:22pm UTC](https://discourse.julialang.org/t/analogue-of-zero-t-for-infinitiy/7027/5 "2017-11-12T20:22:11Z")

</div>

For any subtype of `Number`, `zero(T)` is just a shorthand for `convert(T, 0)`. See: [https://github.com/JuliaLang/julia/blob/6a23e234e6cc5b4361b5f88614a9ed423dc2c12a/base/number.jl#L238](https://github.com/JuliaLang/julia/blob/6a23e234e6cc5b4361b5f88614a9ed423dc2c12a/base/number.jl#L238)

And for _any_ type T, if you haven’t defined a constructor `T(x)`, then it will also fall back to `convert(T, x)`. See: [https://github.com/JuliaLang/julia/blob/6a23e234e6cc5b4361b5f88614a9ed423dc2c12a/base/sysimg.jl#L114](https://github.com/JuliaLang/julia/blob/6a23e234e6cc5b4361b5f88614a9ed423dc2c12a/base/sysimg.jl#L114)

---

_[View the full topic](https://discourse.julialang.org/t/analogue-of-zero-t-for-infinitiy/7027)._
