---
title: "Conversions between numeric types"
url: https://daily.dev/posts/conversions-between-numeric-types-agtaw8e1q
source_url: https://boldlygo.tech/archive/2024-03-06-conversions-between-numeric-types
type: article
source: "Boldly Go"
published: 2026-05-31T07:49:26.649Z
updated: 2026-05-31T09:05:05.790Z
tags: ["golang"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversions between numeric types

**[Boldly Go](https://daily.dev/sources/boldlygo)** · 2 min read · 0 upvotes · 0 comments

## Summary

A focused walkthrough of Go's numeric type conversion rules, covering integer-to-integer conversions (sign extension and zero extension with truncation), floating-point-to-integer truncation (no rounding, always toward zero), and integer/float-to-float conversions (rounding, not truncation). Includes concrete code examples showing potential data loss and surprising rounding behavior. Also notes that conversions involving floating-point values where the result type cannot represent the value are implementation-dependent, potentially allowing panics on certain CPU architectures.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://boldlygo.tech/archive/2024-03-06-conversions-between-numeric-types>

---

Tags: [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/conversions-between-numeric-types-agtaw8e1q)
