digitalmars.D.learn - Integer types
- Jared McKinnan (4/4) Oct 08 Hello there,
- Imperatorn (5/9) Oct 08 You need to specify your platform.
- Jared McKinnan (2/14) Oct 08 I using Windows 10 x64.
- Salih Dincer (14/18) Oct 09 ```int_fast64_t``` is the fastest 64-bit or larger integer type.
- Jared McKinnan (2/16) Oct 09 Thank you. That helps.
Hello there, Just wanted to ask if there's a real difference between e.g. the "long" type and "int_fast64_t" in terms of execution times. Thanks
Oct 08
On Tuesday, 8 October 2024 at 15:57:24 UTC, Jared McKinnan wrote:Hello there, Just wanted to ask if there's a real difference between e.g. the "long" type and "int_fast64_t" in terms of execution times. ThanksYou need to specify your platform. In most cases, no, you won't see a difference. It exists so that if the platform has faster arithmetic for a certain size, it can choose that size.
Oct 08
On Tuesday, 8 October 2024 at 16:39:26 UTC, Imperatorn wrote:On Tuesday, 8 October 2024 at 15:57:24 UTC, Jared McKinnan wrote:I using Windows 10 x64.Hello there, Just wanted to ask if there's a real difference between e.g. the "long" type and "int_fast64_t" in terms of execution times. ThanksYou need to specify your platform. In most cases, no, you won't see a difference. It exists so that if the platform has faster arithmetic for a certain size, it can choose that size.
Oct 08
On Tuesday, 8 October 2024 at 15:57:24 UTC, Jared McKinnan wrote:Hello there, Just wanted to ask if there's a real difference between e.g. the "long" type and "int_fast64_t" in terms of execution times. Thanks```int_fast64_t``` is the fastest 64-bit or larger integer type. The type that is at least 64 bits long and works fastest on the platform is selected. This type can be selected if performance is more important than memory and the processor can run faster on certain types. ```long``` is an integer that is strictly 64 bits long. That is, this type is permanently 64 bits and provides cross-platform portability. If you want strictly 64 bits and care about cross-platform consistency, you should use this type. So you have to choose between consistency and efficiency. When you tell the compiler this choice, it implements it if it can agree with the processor. SDB 79
Oct 09
On Wednesday, 9 October 2024 at 12:12:22 UTC, Salih Dincer wrote:[...] ```int_fast64_t``` is the fastest 64-bit or larger integer type. The type that is at least 64 bits long and works fastest on the platform is selected. This type can be selected if performance is more important than memory and the processor can run faster on certain types. ```long``` is an integer that is strictly 64 bits long. That is, this type is permanently 64 bits and provides cross-platform portability. If you want strictly 64 bits and care about cross-platform consistency, you should use this type. So you have to choose between consistency and efficiency. When you tell the compiler this choice, it implements it if it can agree with the processor. SDB 79Thank you. That helps.
Oct 09