# Syntax Surprises

**URL:** https://discourse.julialang.org/t/syntax-surprises/92369
**Category:** General Usage
**Tags:** syntax, discussion, fun, gotchas
**Created:** [December 31, 2022, 8:00pm UTC](https://discourse.julialang.org/t/syntax-surprises/92369 "2022-12-31T20:00:02Z")
**Posts on this page:** 4
**Page:** 5

<div class="post-metadata">

### Author: ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)
#### Post date: [January 21, 2023, 9:30am UTC](https://discourse.julialang.org/t/syntax-surprises/92369/83 "2023-01-21T09:30:56Z")

</div>

I’m not sure it’s that big of a deal; in other places where an `Int` is expected, as long as there’s an exact integer representation, conversion is implicit and expected:

```julia
julia> struct Foo x::Int end

julia> Foo(2e9)
Foo(2000000000)

```

`Float64`s have a 52-bit mantissa (good for about 15 sigfigs), and `Int64`s have a maximum value of 2^{63}-1 \approx 9.2\times 10^{18}, so there’s a large practical range of overlap.

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [January 21, 2023, 9:33am UTC](https://discourse.julialang.org/t/syntax-surprises/92369/84 "2023-01-21T09:33:25Z")

</div>

> [@uniment](#):
>
> In how many scenarios would this be of benefit?

I’m not sure I understand the question. It would be of benefit every time you need a big integer (one common one being `for i in 1:2e9`).

It’s not a real suggestion, though, I just miss a convenient syntax for large Ints.

---

<div class="post-metadata">

### Author: ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)
#### Post date: [January 21, 2023, 9:43am UTC](https://discourse.julialang.org/t/syntax-surprises/92369/85 "2023-01-21T09:43:24Z")

</div>

> [@](#):
>
> not sure I understand the question

I’m mostly just pondering if your desire for a convenience syntax for large Ints, couldn’t be satisfied by a few implicit `Float64`→`Int` conversions in the language.

`for i=1:2e9` is a pretty good example of a place where it wouldn’t work though.

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [January 21, 2023, 9:45am UTC](https://discourse.julialang.org/t/syntax-surprises/92369/86 "2023-01-21T09:45:59Z")

</div>

> [@uniment](#):
>
> a few implicit `Float64`→`Int` conversions in the language.

Maybe it would work, but it would be very nice, I fear.

[Previous page](https://discourse.julialang.org/t/syntax-surprises/92369.md?page=4)
