INT/de

From MCS Wiki AVR
< INT(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Example)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
== (**COPIED FROM ENGLISH PAGE**) === <span class="f_Header">Action</span> =
+
= <span class="f_Header">Funktion</span> =
  
Returns the integer part of a single or double.
+
Gibt den Ganzzahl-Anteil (Integer part) einer Single oder Double Zahl zurück.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="539" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="539" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="14%" style="width: 72px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="14%" style="width: 72px; border: 1px solid rgb(0, 0, 0);" |  
Var
+
var
  
 
| valign="top" width="100%" style="width: 458px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 458px; border: 1px solid rgb(0, 0, 0);" |  
A numeric variable that is assigned with the integer of variable source.
+
Numerische Variable der der Ganzzahl-Anteil der Variablen source zugewiesen wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="14%" style="width: 72px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="14%" style="width: 72px; border: 1px solid rgb(0, 0, 0);" |  
Source
+
source
  
 
| valign="top" width="100%" style="width: 458px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 458px; border: 1px solid rgb(0, 0, 0);" |  
The source variable to get the integer of.
+
Quellvariable von der der Ganzzahl-Anteil ermittelt werden soll.
  
 
|}
 
|}
Line 36: Line 36:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
The fraction is the right side after the decimal point of a single.
+
Fraction ist der Teil einer Single-Zahl nach dem Komma.
  
The integer is the left side before the decimal point.
+
Integer ist der Teil vor dem Komma.
  
<span style="font-family: Arial;">&nbsp;</span>
+
<span style="font-family: Arial;"></span>
 
+
Beispiel: 1234.567  
1234.567 1234 is the integer part, .567 is the fraction
+
Der Integer-Teil ist 1234 und Fraction ist .567  
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 48: Line 48:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">See Also</span> =
+
= <span class="f_Header">Siehe auch</span> =
  
 
[[FRAC]]&nbsp;,&nbsp;[[FIX]]&nbsp;,&nbsp;[[ROUND]]
 
[[FRAC]]&nbsp;,&nbsp;[[FIX]]&nbsp;,&nbsp;[[ROUND]]
Line 56: Line 56:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">
Line 69: Line 69:
 
   
 
   
 
$regfile = "m48def.dat" ' specify the used micro
 
$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
+
$crystal = 4000000 ' Taktrate
$baud = 19200 ' use baud rate
+
$baud = 19200 ' Baudrate
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$swstack = 10 ' default use 10 for the SW stack
 
$swstack = 10 ' default use 10 for the SW stack

Latest revision as of 23:13, 2 March 2013

Contents

Funktion

Gibt den Ganzzahl-Anteil (Integer part) einer Single oder Double Zahl zurück.

 

 

Syntax

var = INT( source )

 

 

Anmerkungen

var

Numerische Variable der der Ganzzahl-Anteil der Variablen source zugewiesen wird.

source

Quellvariable von der der Ganzzahl-Anteil ermittelt werden soll.

 

Fraction ist der Teil einer Single-Zahl nach dem Komma.

Integer ist der Teil vor dem Komma.

Beispiel: 1234.567 Der Integer-Teil ist 1234 und Fraction ist .567

 

 

Siehe auch

FRAC , FIX , ROUND

 

 

Beispiel


'-----------------------------------------------------------------------------------------
'name : round_fix_int.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demo : ROUND,FIX
'micro : Mega48
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' Taktrate
$baud = 19200 ' Baudrate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Dim S As Single , Z As Single
For S = -10 To 10 Step 0.5
Print S ; Spc(3) ; Round(s) ; Spc(3) ; Fix(s) ; Spc(3) ; Int(s)
Next
End

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language