English
Source / code snippets

binary Dezimal Zahlensysteme

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Zahlensysteme: binär <-> dezimal
Autor: Dieter Zornow
code zur freien Verwendung
XProfan 9 beta

proc BinToDez

    parameters bin$
    declare count%,sum&,place%
    sum& = 0
    count% = len(bin$)
    place% = count%

    whileloop 0,count%-1 Profan ab 7.0

        sum& = sum& + Val(mid$(bin$,place%,1)) * 2 ^ &loop
        dec place%

    endwhile

    return sum&

endproc

proc DezToBin

    parameters dez&
    @Set(Decimals,0) Profan 9.0
    declare rest$,temp&,return$
    rest$ =

    whilenot dez& < 1

        temp& = dez&  2
        rest$ = rest$ + str$(dez& mod 2)
        dez& = temp&

    endwhile

    temp& = len(rest$)
    return$ =

    whileloop len(rest$) Profan ab 7.0

        return$ = return$ + mid$(rest$,temp&,1)
        dec temp& Profan ab 8.0

    endwhile

    @Set(Decimals,6) Profan 9.0
    return Trim$(return$)

endproc

cls
BinToDez str$(11101101)
print @&(0)
DezToBin @&(0)
print @&(0)
waitinput
href='./../../function-references/XProfan/end/'>end
 
07/15/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.645 Views

Untitledvor 0 min.
H.Brill09/26/24
E.T.01/14/24
GDL09/12/15
RudiB.11/26/13
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie