What about a nice companion for #MaxLong?
Even if #MaxInteger is the same like 1<<(#PB_Compiler_Processor<<4-1)-1 for X86 architecture it could be useful.
#MaxInteger would be fine
- Michael Vogel
- Addict
- Posts: 2798
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: #MaxInteger would be fine
#MaxLong is a Windows api constant, not PB. That being said, equivalents in PB could be useful.
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: #MaxInteger would be fine
We can easily use something like this:
Regards, Little John
Code: Select all
;-- range of *signed* 32-bit integers
#MIN_32BIT_S = -$80000000 ; = -Pow(2,31)
#MAX_32BIT_S = $7FFFFFFF ; = Pow(2,31)-1
;-- range of *unsigned* 32-bit integers
#MIN_32BIT_U = 0
#MAX_32BIT_U = $FFFFFFFF ; = Pow(2,32)-1
;-- range of *signed* 64-bit integers
#MIN_64BIT_S = -$8000000000000000 ; = -Pow(2,63)
#MAX_64BIT_S = $7FFFFFFFFFFFFFFF ; = Pow(2,63)-1
Re: #MaxInteger would be fine
Code: Select all
#PB_MinByte = -$80
#PB_MaxByte = $7F
#PB_MinAscii = $00
#PB_MaxAscii = $FF
#PB_MinWord = -$8000
#PB_MaxWord = $7FFF
#PB_MinUnicode = $0000
#PB_MaxUnicode = $FFFF
CompilerIf SizeOf(Character) = SizeOf(Ascii)
#PB_MinCharacter = #PB_MinAscii
#PB_MaxCharacter = #PB_MaxAscii
CompilerElse
#PB_MinCharacter = #PB_MinUnicode
#PB_MaxCharacter = #PB_MaxUnicode
CompilerEndIf
#PB_MinLong = -$80000000
#PB_MaxLong = $7FFFFFFF
#PB_MinQuad = -$8000000000000000
#PB_MaxQuad = $7FFFFFFFFFFFFFFF
CompilerIf SizeOf(Integer) = SizeOf(Long)
#PB_MinInteger = #PB_MinLong
#PB_MaxInteger = #PB_MaxLong
CompilerElse
#PB_MinInteger = #PB_MinQuad
#PB_MaxInteger = #PB_MaxQuad
CompilerEndIf
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module