On Sunday, August 28, 2016 at 11:00:53 AM UTC+8, Ian Lance Taylor wrote:
>
> On Sat, Aug 27, 2016 at 12:41 AM, T L <tapi...@gmail.com <javascript:>> 
> wrote: 
> > 
> > I don't think an int64 value can be converted to an int value is for 
> they 
> > have the same underlying type. 
> > In fact, an int8 value can also be converted to an int value. 
> > "Number values can be converted to values of other number types" is 
> totally 
> > an exception for the conversion rule. 
> > This has nothing related to the underlying types. 
>
> I'm sorry, I don't understand the point you are making. 
>
> Ian 
>

isn't the basic conversion rule is two values with a same underlying type 
can be converted to each other' type?
(another basic conversion rule is, if T implements interface I, the values 
of T can be converted to values of I)

The underlying types of different numeric types are different. 
Golang just makes an exception/convenience to make it is possible to 
convert the values of these types to any of these types.

And there is another exception, integer values can be converted to string, 
this is one-direction conversion.


 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to