How can I define a long that is bigger than 32 bit, because when I do so I receive "Invalid number. Numbers are limited to 32-bits of precision."
Thanks in Advance
How to define long?
Moderator: DosItHelp
Re: How to define long?
Batch does not have native support for integers larger than 32 bit.
So if you are dealing with large numbers, then the first suggestion is - don't use batch. Use some other scripting language that does support large numbers (even floating point), such as JScript, VBScript, or PowerShell.
If you really are committed to using batch, then you can use hybrid techniques to incorporate JScript, VBScript, or PowerShell into batch to handle large numbers.
Here is JEval.bat: viewtopic.php?t=6212
And a general discussion of batch hybrid techniques can be found at: viewtopic.php?t=5543
Or if you really insist, you can look into existing libraries of pure batch routines to work with large numbers. I haven't used either one, so I can't make a recommendation.
From Judago: viewtopic.php?t=7170
From Ron: viewtopic.php?f=3&t=8332
Dave Benham
So if you are dealing with large numbers, then the first suggestion is - don't use batch. Use some other scripting language that does support large numbers (even floating point), such as JScript, VBScript, or PowerShell.
If you really are committed to using batch, then you can use hybrid techniques to incorporate JScript, VBScript, or PowerShell into batch to handle large numbers.
Here is JEval.bat: viewtopic.php?t=6212
And a general discussion of batch hybrid techniques can be found at: viewtopic.php?t=5543
Or if you really insist, you can look into existing libraries of pure batch routines to work with large numbers. I haven't used either one, so I can't make a recommendation.
From Judago: viewtopic.php?t=7170
From Ron: viewtopic.php?f=3&t=8332
Dave Benham