Download MCS Electronics , 1995-2008 - Departamento de Automatización y

Transcript
566
BASCOM-AVR
Do
Incr A
If A = 10 Then
Exit Do
End If
Loop
Print "Loop terminated"
End
6.188 EXP
Action
Returns e( the base of the natural logarithm) to the power of a single or double
variable.
Syntax
Target = EXP(source)
Remarks
Target
Source
The single or double that is assigned with the Exp() of the target.
The source to get the Exp of.
See also
LOG
645
, LOG10
646
Example
'-----------------------------------------------------------------------------'copyright
: (c) 1995-2005, MCS Electronics
'micro
: Mega88
'suited for demo
: no, but without the DOUBLE, it works for
DEMO too in M48
'commercial addon needed : no
'purpose
: demonstrates EXP function
'-----------------------------------------------------------------------------$regfile = "m88def.dat"
the used micro
$crystal = 8000000
crystal frequency
$baud = 19200
rate
$hwstack = 32
use 32 for the hardware stack
$swstack = 40
use 10 for the SW stack
$framesize = 40
use 40 for the frame space
' specify
' used
' use baud
' default
' default
' default
Dim X As Single
X = Exp(1.1)
Print X
© 2008 MCS Electronics