On Tue, Aug 4, 2020 at 12:31 PM Martin Møller Skarbiniks Pedersen <
traxpla...@gmail.com> wrote:

bet := int64(math.Ceil(float64(cash)/float64(4)))
>
>
Programming languages must make a conscious choice here. Do we make type
casts explicit or implicit? Go opted for the explicit approach, probably
based on the experience of C, where type promotion follows certain implicit
rules.

The advantage of an explicit approach is that you remove certain classes of
subtle errors from programs, in a trade-off for more typing. You can
arrange your values such that they already have the correct type at times,
but otherwise you have to make the conversion yourself explicitly in the
program.

-- 
J.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGrdgiV%3DHb%2BaQEq%3D%3D-4Xbn20U962Ye%2BsebUgqbQRGVyiwx5bnw%40mail.gmail.com.

Reply via email to