Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Addendum: SGN function does not work correctly Kategorie: Programmierung Basic (von Windt H.J. - 20.06.2011 17:36)
 Als Antwort auf Addendum: SGN function does not work correctly von MaPi - 19.06.2011 1:35
> Just an addendum as a result of my recent work:
> I just found out that the SGN function in CControl 1 V2.0 does not work correctly.
> When evaluating a positive number, for example SGN(5), the function replies (0) instead of (1).
> I made a workaround with some IF THEN lines as shown below:
>
> 'ROUTINE ALS ERSATZ DER DEFEKTEN SGN-FUNKTION
> 'in wird zu pruefender Wert uebergeben
>
> #Signum_Funktion
> IF C < 0 THEN GOTO Kleiner_Null
> IF sw_Function1_Return = 0 THEN GOTO Gleich_Null
> IF sw_Function1_Return > 0 THEN GOTO Groesser_Null
> #Kleiner_Null
> sw_Function1_Return = -1
> RETURN
> #Gleich_Null
> sw_Function1_Return = 0
> RETURN
> #Groesser_Null
> sw_Function1_Return = 1
> RETURN
>
> MaPi

 Antwort schreiben

Bisherige Antworten:

Re: Addendum: SGN function does not work correctly (von MaPi - 20.06.2011 21:57)