SGN/de

From MCS Wiki AVR
< SGN(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Example)
 
(One intermediate revision by one user not shown)
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="8%" style="width: 39px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="8%" style="width: 39px; border: 1px solid rgb(0, 0, 0);" |  
Var
+
var
  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
A single or double variable that is assigned with the SGNS of variable x.
+
Single oder Double Variable der das Vorzeichen der Variablen x zugewiesen wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="8%" style="width: 39px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="8%" style="width: 39px; border: 1px solid rgb(0, 0, 0);" |  
X
+
x
  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" style="border: 1px solid rgb(0, 0, 0);" |  
The single or double to get the sign of.
+
Single oder Double Zahl von der das Vorzeichen bestimmt werden soll.
  
 
|}
 
|}
Line 36: Line 36:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
For values <0, -1 will be returned
+
Für Werte <0 wird -1 zurückgegeben.
  
For 0, 0 will be returned
+
Für 0 wird 0 zurückgegeben.
  
For values >0, 1 will be returned
+
Für Werte >0 wird 1 zurückgegeben.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 54: Line 54:
 
<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">

Latest revision as of 23:03, 2 March 2013

Contents

Funktion

Gibt das Vorzeichen einer Gleitkommazahl zurück.

 

 

Syntax

var = SGN( x )

 

 

Anmerkungen

var

Single oder Double Variable der das Vorzeichen der Variablen x zugewiesen wird.

x

Single oder Double Zahl von der das Vorzeichen bestimmt werden soll.

 

Für Werte <0 wird -1 zurückgegeben.

Für 0 wird 0 zurückgegeben.

Für Werte >0 wird 1 zurückgegeben.

 

 

See Also

INT , FIX , ROUND

 

 

Beispiel


Dim S As Single , X As Single , Y As Single
X = 2.3 : S = Sgn(x) 
Print S
X = -2.3 : S = Sgn(x)
Print S
End

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