English
Includes

maths slight made - INCLUDE with leichtem code.

 

Gary12345
Hi,

I have a Include based on leichtem XPROFAN code prepares.

Download

functions from the code ablesbar!

10 kB
Hochgeladen:02/01/13
Downloadcounter262
Download
 
MfG
Gary12345
01/27/13  
 



hint:

You write z.B.:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)
    ADreieck! = 0.5*a!*b!
    ROUND(ADreieck!,2)
    return

E

richtiger would:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)
    ADreieck! = 0.5*a!*b!
    return ROUND(ADreieck!,2)

ENDPROC


or same:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    set("decimals",2)
    return ROUND(0.5*a!*b!,2)

ENDPROC

 
01/27/13  
 




Gary12345
Why? shining still everything correctly. To go? i see simply the return not integrally, though I it tausendmal in the Help nachgelesen have o.O
 
XProfan X2
MfG
Gary12345
01/27/13  
 




Jörg
Sellmeyer
there are we any glad, that The whole Rechenoperationen not any more with functions carryed out go must, separate directly with the Operanden Done go can and You want tappt im dunkeln again to introduce?

Return kehrt a procedure directly on the place back into Hauptprogramm. If one After Return a worth writes, becomes this worth as Result from the procedure zurückgeliefert:
CompileMarkSeparation
Proc Ergebnis

    Parameters Wert$
    Declare Rueckgabe$
    Rueckgabe$ = "Nix passiert"

    If Wert$ = "Ja"

        Return Wert$

    ElseIf Wert$ = "Nein"

        Return "Da könnte ja jeder kommen"

    Else

        Return Rueckgabe$

    EndIf

EndProc

Cls
Print Ergebnis("Ja")
Print Ergebnis("Nein")
Print Ergebnis("Vielleicht")
WaitInput

this is a little elegant method, shows but, How Return functions.
rather would been, in the If-request whom String Rueckgabe$ with the desired Result To bestücken and integrally end The procedure with Return Rueckgabe$ To leave:
CompileMarkSeparation
Proc Result

    Parameters worth$
    Declare Rueckgabe$
    Rueckgabe$ = "Nix passiert"

    If worth$ = "Ja"

        Rueckgabe$ = worth$

    ElseIf worth$ = "Nein"

        Rueckgabe$ = "Da could Yes eachone kommen"

    EndIf

    Return Rueckgabe$

ENDPROC

Cls
Print Result("Ja")
Print Result("Nein")
Print Result("Vielleicht")
WaitInput
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
01/27/13  
 




Gary12345
Hi,
CompileMarkSeparation
'Include programmiert von Gary12345

Proc Summe

    parameters a!,b!
    declare Summe!
    set("decimals",2)
    Summe! = a!+b!
    return ROUND(Summe!,2)

EndProc

Proc Minus

    parameters a!,b!
    declare Minus!
    set("decimals",2)
    Minus! = a!-b!
    return ROUND(Minus!,2)

EndProc

Proc Teilen

    parameters a!,b!
    declare Teilen!
    set("decimals",2)
    Teilen! = a!/b!
    return ROUND(Teilen!,2)

EndProc

Proc Multiplizieren

    parameters a!,b!
    declare multiplizieren!
    set("decimals",2)
    multiplizieren! = a!*b!
    return ROUND(Multiplizieren!,2)

EndProc

Proc Wurzel

    parameters a!
    declare Wurzel!
    set("decimals",2)
    Wurzel! = sqrt(a!)
    return Round(Wurzel!,2)

EndProc

Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)
    ADreieck! = 0.5*a!*b!
    return ROUND(ADreieck!,2)

EndProc

Proc AQuadrat

    parameters a!
    declare Quadrat!
    set("decimals",2)
    Quadrat!=a!*a!
    return ROUND(Quadrat!,2)

EndProc

Proc ARechteck

    parameters a!,b!
    declare Rechteck!
    set("decimals",2)
    Rechteck! = a!*b!
    return ROUND(Rechteck!,2)

EndProc

Proc AKreis

    parameters a!
    declare Kreis!
    set("decimals",2)
    Kreis! = @Pi()*a!
    return ROUND(Kreis!,2)

EndProc

Proc ATrapez

    parameters a!,c!,h!'Trapezformel: 0.5*(a+c)*höhe! (h!)
    declare Trapez!
    set("decimals",2)
    Trapez! = 0.5*(a!+c!)*h!
    return ROUND(Trapez!,2)

EndProc

Proc AParallelogramm

    parameters g!,h!
    declare Parallelogramm!
    set("decimals",2)
    Parallelogramm! = g!*h!'Grundfläche*Höhe
    return ROUND(Parallelogramm!,2)

EndProc

Proc VWürfel

    Parameters a!
    declare Würfel!
    set("decimals",2)
    Würfel! = a!*a!*a!
    return ROUND(Würfel!,2)

EndProc

Proc VQuader

    Parameters a!,b!,c!
    declare Quader!
    set("decimals",2)
    Quader! = a!*b!*c!
    return ROUND(Quader!,2)

EndProc

Proc VKugel

    parameters r!
    declare Kugel!
    set("decimals",2)
    Kugel! = 4/3*@PI()*r!*r!*r!
    return ROUND(Kugel!,2)

EndProc

Proc VKegel

    parameters r!,h!
    declare Kegel!
    set("decimals",2)
    Kegel! = 1/3*@PI()*r!*r!*h!
    return ROUNDss=s2>(cone!,2)

ENDPROC


speak, the would then correctly.?

LG
 
XProfan X2
MfG
Gary12345
01/28/13  
 



iF (27.01.13)


...

richtiger would:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    declare ADreieck!
    set("decimals",2)
    ADreieck! = 0.5*a!*b!
    return ROUND(ADreieck!,2)

En
/a>

or same:
CompileMarkSeparation
Proc ADreieck

    parameters a!,b!
    set("decimals",2)
    return ROUND(0.5*a!*b!,2)

ENDPROC


...



Ergo?
 
01/28/13  
 




Gary12345
Nimm option2. The Although longer, but shining me leichter To his. then is my code still correctly..

will be then vll over again inquiries, because I on a problem punched be. Erstmal on needlework nachrechnen and then whom Error search (In maths be I Yes Nich the best ;) )

thanks!
 
XProfan X2
MfG
Gary12345
01/28/13  
 




Gary12345

CompileMarkSeparation
Proc Lösungsformel1'Wert bei -b-...

    parameters a!,b!,c!
    declare Lösungsformel!
    set("decimals",2)
    Lösungsformel! = (-b!-sqrt(b!*b!-4*a!*c!))/(2*a!)
    return ROUND(Lösungsformel!,2)

En
/a>

I definiere, I make wants:

1. What is a quadratische Gleichung?

ax²+bx+c=0

example: 
3x²+2x+4=0

2. How can such quadratischen Gleichungen calculate?

Since there it a offizielle Formel (called Lösungsformel the quadratischen Gleichungen):

-b+root(b²-4⋅a⋅c) / 2*a
-b-root(b²-4*a*c) / 2*a

so far understood?

3. How can I the in XPROFAN transfiguring?

supra have your yet written code for these Formel. now supply tappt im dunkeln incorrect values and crashes with negativen Values ex? (EDIT: overthrows not only with negativen Values ex!)

have the in praktischer shape attempts (means handschriftlich), come however still not to Solution the Problems (conversion in XPROFANCODE).

Testwert, where it by me crashes:
CompileMarkSeparation
var Test1! = Lösungsformel1(2,3,4)
print Test1!

thanks for eure Help already time in the Vorraus!
 
MfG
Gary12345
01/28/13  
 




Dieter
Zornow
the set("decimals",2) need one still not eachone proc. once at the beginning outside the Procs insert reicht still.
CompileMarkSeparation
set("decimals",2)

Proc Summe

    parameters a!,b!
    return ROUND( a!+b!,2)

EndProc

proc .......

endproc

proc ........

endproc

etc.

then could the User too yet as option The Number of Nachkommastellen determine.

an& = readini .........
set("decimals",an&)
 
XProfan X2
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
01/28/13  
 




Thomas
Freier
I go even so far, that weder DECIMALS yet ROUND something in the PROC to search to have. this is in the program To regulate. Berechnungen should max. Nachkommastellen having circa further Berechnungen not To verfälschen.
 
Gruß Thomas
Windows XP SP2, XProfan X2
01/28/13  
 




Gary12345
Jo thanks. i'd ehrlicherweise first yet couple functions install, thereafter could I circa this trouble concern.

has someone a Idea of quadratischen Gleichungen. mail see 2-3 Posts over me

LG
 
XProfan X2
MfG
Gary12345
01/28/13  
 



Ehm?

r!=b!+sqrt(b!*b!-4*a!*c!) / 2*a!
 
01/28/13  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

51.212 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
XProfan Newbie02/18/23
rafl06/21/22
Member 229993110/21/19
More...

Themeninformationen



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