M
M
mlyamasov2021-07-27 22:20:16
Haskell
mlyamasov, 2021-07-27 22:20:16

What is the actual size of the Int type on the GHC platform, Windows 64?

I googled that the size of the sish type int on Linux 32, Linux 64, Windows 32, Windows 64 platforms is 4 bytes.
Interested in the actual size of the Int type when programming in Haskell.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mlyamasov, 2021-07-28
@mlyamasov

I answer myself.
I managed to find a cloud with Windows Server 2019, 64 bit.
In this cloud, I downloaded the old version of Haskell Platform.
There are no new versions of Haskell Platform, instead they offer some kind of Chocolatey with registrations and SMS.
As a result, I got that sizeOf (undefined :: Int) = 8.

A
Alexander Skusnov, 2021-07-28
@AlexSku

I have maxBound ::Int exactly 2^31 (i.e. 4 bytes, high bit is a sign)

A
aagzip, 2021-07-28
@aagzip

The finite-precision integer type Int covers at least the range [ - 2^29, 2^29 - 1]
https://www.haskell.org/onlinereport/basic.html#numbers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question