Issue 28 of 30 Days of Hack (HHVM)
You know that Hack distinguish between int and float. This does always work as you can expect. If you take the sum of two ints you will get an int. If you multiply an int and a float you will get a float. But how does Hack handle it when you divide one int with another? Will it return an int or a float?
There is no way to statically determine what should be returned. Hack uses a other data type num. This can only be used internally and you may never annotate with num. When you are multiplying a num with an int or float you will get a num.
In many cases you don’t need to bother about the num, but if you need to return the value or use it in a function call you have to cast it into the proper data type.