"David Brown" <david@westcontrol.removethisbit.com> wrote in message
news:46d6be01$0$3197$8404b019@news.wineasy.se...
> Skybuck Flying wrote:
>> "David Brown" <david@westcontrol.removethisbit.com> wrote in message
>> news:46d6a788$0$27847$8404b019@news.wineasy.se...
>>> Skybuck Flying wrote:
>>>> There is definetly a speed difference especially for mul and div for
>>>> the modes I described.
>>>>
>>>> Why do I have to choose the data type ?
>>>>
>>>> Why can't the program choose the data type at runtime ?
>>>>
>>> If *you* are writing the program, *you* should know what sort of data is
>>> stored in each variable. *You* can then tell the compiler by choosing
>>> an appropriate data type. Is that so hard to grasp? It is up to *you*
>>> to figure out that what limits there will be on the size of the data you
>>> are using, and therefore pick 32-bit or 64-bit (or whatever) integers
>>> for your program. If you think there could be large variations in the
>>> sizes, then either use a data type that will certainly be big enough, or
>>> pick one with no arbitrary limit (there are multiple precision integer
>>> libraries available for most languages), or use a dynamically typed
>>> language.
>>
>> Well that clearly sucks.
>>
>> The world is not completely 64 bit, The world is not statis it
>> fluctuates.
>>
>> Sometimes the program only needs 32 bits, sometimes 64 bits.
>>
>> Always choosing 64 bits would hurt performance LOL.
>>
>
> So if your program needs 32 bits, use 32 bits. If it needs 64 bits, use
> 64 bits.
Yes very simply statement.
Achieving this in a scalable way is what this thread is all about.
Re-writing code, or writing double code, or even using multiple libraries is
not really what this is about.
It's nearly impossible to achieve without hurting performance. Only
solutions might be c++ templates or generics, not even sure how easy it
would be to switch between two generated class at runtime.
Bye,
Skybuck.