# Wrap and inherit Number

**URL:** <https://discourse.julialang.org/t/wrap-and-inherit-number/4799>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 12, 2017, 11:24am UTC](https://discourse.julialang.org/t/wrap-and-inherit-number/4799 "2017-07-12T11:24:34Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [July 13, 2017, 9:00am UTC](https://discourse.julialang.org/t/wrap-and-inherit-number/4799/21 "2017-07-13T09:00:00Z")

</div>

Very cool.

I’d like to add some clarity as well:  
The “thing” that would be most useful (and maybe I should open a new topic for this), is if we could just have something that acts exactly like a `Number` (in every meaning), but that we can override some of the functions that already accept it as an argument.

So here’s an instance of `Float64`:  
`Float64(33.0)`  
We can do all sorts of things with it. Here is an instance of a custom type `A`:  
`A(33.0)`  
We can do exactly the same things like the `Float64` version from before. Now I change the existing `sin` function to the following (silly):  
`sin(x::A) = 2x`.  
There. Instances of `A` do everything, say, floats can do, and I modified the behavior of a few select functions. Winning.

---

_[View the full topic](https://discourse.julialang.org/t/wrap-and-inherit-number/4799)._
