Seite 1 von 1

Konstanten Sammlung

Verfasst: 09.10.2009 20:58
von STARGÅTE
Tachchen,

Vielleicht hat der eine oder andere ja selber sein Include mit allen möglichen Konstanten die er/man noch so braucht.
Trotzdem möchte ich hier eine Sammlung für weitere Konstanten anlegen, für die, die sie noch nicht haben.

Damit hier gleich Ordnung ist, würde ich hier auf der ersten Seite alle CodeBrocken die ihr oder ich Postet verlinken, als Inhaltsverzeichnis

Konstanten Sammlung

Re: Konstanten Sammlung

Verfasst: 09.10.2009 20:59
von STARGÅTE
Minimaler/Maximaler Wert eines Vaiablentypes

Code: Alles auswählen

#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) = 1
  #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) = 4
  #PB_MinInteger = #PB_MinLong
  #PB_MaxInteger = #PB_MaxLong
CompilerElse
  #PB_MinInteger = #PB_MinQuad
  #PB_MaxInteger = #PB_MaxQuad 
CompilerEndIf

Re: Konstanten Sammlung

Verfasst: 09.10.2009 21:00
von STARGÅTE
Mathematische Konstanten & Umrechnungen

Code: Alles auswählen

#TwoPI  = #PI*2
#HalfPI = #PI/2

#Rad = #PI/180  ; Umrechungsfaktor von Grad zu Rad
#Ang = 180/#PI  ; Umrechungsfaktor von Rad zu Grad

#E    = 2.7182818284590452354  ; Eulersche zahl

#SQR2 = 1.4142135623730950488  ; Wurzel 2
#SQR3 = 1.7320508075688772935  ; Wurzel 3
#SQR5 = 2.2360679774997896964  ; Wurzel 5

#GoldenRatio = 1.6180339887498948482  ; Goldener Schnitt

Re: Konstanten Sammlung

Verfasst: 09.10.2009 21:00
von STARGÅTE
Vorsätze in Informatik, Mathematik und Physik

Code: Alles auswählen

; SI-Präfix
#Yotta = 1e24
#Zetta = 1e21
#Exa   = 1e18
#Peta  = 1e15
#Tera  = 1e12
#Giga  = 1e9
#Mega  = 1e6
#Kilo  = 1e3
#Hecto = 1e2
#Deca  = 1e1
#Deci  = 1e-1
#Centi = 1e-2
#Milli = 1e-3 
#Micro = 1e-6
#Nano  = 1e-9
#Pico  = 1e-12
#Femto = 1e-15
#Atto  = 1e-18
#Zepto = 1e-21
#Yocto = 1e-24

; Binär-Präfix
#Kibi  = 1<<10
#Mebi  = 1<<20
#Gibi  = 1<<30
#Tebi  = 1<<40
#Pebi  = 1<<50
#Exbi  = 1<<60

; Zeit-Präfix
#Minute = 60
#Hour   = 3600
#Day    = 86400
#Week   = 604800