English
Experimente

Näherungsbruch detect

 

p.specht

The number Pi can with 22/7 on concise three Kommastellen very Pinned go - for Berechnungen in House and court reicht the completely. with 333/106-stel could too Brückenbauer already something begin. and with 140/99-stel for root-from-2 is one for virtually tack too already very well bedient.

One Program, the for arbitrary Point numbers in the "normalen" Wertebereich (means without too strong Stellenexponenten 10^...) checks, whether one tappt im dunkeln itself with Brüchen not leichter remember could, is therefore not uninteressant. with the #-Button can incidentally a in the program self programmed Constant eingeblendet go.
Window Title "N Ä H E R u n G s B R u C H   s u C H E n -   Early beta-Version!"
'(CL) CopyLeft 2014-05 by P.woodpecker, Wien. No however geartete Gewähr!
Def !Pi 3.1415926535897932384626433832795
Def !PiDiv180 0.01745329251994329576923690768489
Def !Div180Pi 57.295779513082320876798154814105
Def !Euler 2.7182818284590452353602874713527
Def !Root2 1.4142135623730950488016887242097
Def !Root3 1.7320508075688772935274463415059
Def !RootPi 1.7724538509055160272981674833411
Def !Root5 2.2360679774997896964091736687313
Def !GoldenRatio 1.6180339887498948482045868343656
Def !Ln10 2.3025850929940456840179914546844
Def !Ln2  0.69314718055994530941723212145818
Def !Lb10 3.3219280948873623478703194294894
Def !LbE  3.921651713656448480581438480269
Def !LLE  1.4426950408889634073599246810019
Def !log2 0.30102999566398119521373889472449
Def !LogE 0.43429448190325182765112891891661
Def !EulerMasc 0.5772156649015328606065120900824024310
Def !Lemniskat 2.62205755429211981046
Def !Sirpinski 2.58498175957925321706
Def !PrimZwill 0.66016181584686957392
Def !SumRezipPrimZwill 1.902160583209
Def !Feigbm1 4.66920160910299067185
Def !Feigbm2 2.50290787509589282228
Def !Fibon 0.29762917531599816807398825978458
Def !RezipFibon 3.3598856662431775531720113029189
Def !ErdGrav 9.80665
Def !Div60 0.01666666666666666666666666666667
Def !Div360 0.00277777777777777777777777777778
Def !Div3600 0.000277777777777777777777777777778
Def !Div24 0.04166666666666666666666666666667
Def !DivPi 0.31830988618379067153776752674503
Def !SecPerDay 86400
Def !DayPerSec 0.000011574074074074074074074074074074
Def !Div1a 0.999999999999999999999999999999
Def !Div2a 0.444444444444444444444444444444
Def !Div2 0.5
Def !Div3 0.33333333333333333333333333333333
Def !Div4 0.25
Def !Div5 0.2
Def !Div6 0.16666666666666666666666666666667
Def !Div7 0.14285714285714285714285714285714
Def !Div8 0.125
Def !Div9 0.11111111111111111111111111111111
Def !Div10 0.1
Def !Div11 0.09090909090909090909090909090909
Def !Div12 0.08333333333333333333333333333333
Def !Div13 0.07692307692307692307692307692308
Def !Div14 0.07142857142857142857142857142857
Def !Div15 0.06666666666666666666666666666667
Def !Div16 0.0625
Def !Div17 0.05882352941176470588235294117647
Def !Div18 0.05555555555555555555555555555556
Def !Div19 0.05263157894736842105263157894737
Def !Div20 0.05
Def !DivHdt 0.01
Def !DivTsd 0.001
Def !DivZTsd 0.0001
Def !DivHTsd 0.00001
Def !DivMio 0.000001
Def !DivMrd 0.000000001
windowstyle 24:window 0,0-%maxx/2,%maxy-40:set("decimals",17):font 2
declare c$,st&,z!,tol!,err!,z&,n&,v!,w!,err_!,n_&,z_&,x&,y&,sn&,tm&
again:
cls:print "\n\n Wieviele STELLEN must the NENNER maximum having (max.~6): ";
input c$:case c$>"":st&=abs(val(c$)):case st&=0:st&=1:case st&>9:st&=9
one:
print "\n How sounds your KOMMAZAHL ? (*=Pi,°=sqrt(2),#=Konstante): ";
input c$:case c$>"":v!=val(c$)
case c$="*":v!=pi():case c$="°":v!=sqrt(2)
case c$="°":v!=sqrt(2)
'--------------------------------------------------------------------------
case lower$(c$)="#":v!=0.001001001001001001001001001001
'--------------------------------------------------------------------------

if v!=0:print " jest, or? ":sound 200,100:locate 4,1:goto "ein":endif

    CLS
    print "\n Sollwert: ";sn&*v!;"\n":err_!=10^53:n&=1:sn&=1

    if v!<0:v!=abs(v!):sn&=-1:endif

        if v!>=1:z&=10^(lg(v!))

        elseif v!<1:n&=int(10^(-1*lg(v!)))

        endif

        while n&<(10^st&)

            w!=z&/n&:err!=v!-w!

            if abs(err!)<err_!:err_!=abs(err!):z_&=z&:n_&=n&

                print " ";int(sn&*z&);" / ";n&;" = ";w!;tab(48);"Abs.Error = ";abs(err!);"  "

            endif

            if err!>0:inc z&

            elseif err!<0:dec z&:inc n&

                else :BREAK

            endif

            if (&gettickcount-tm&)>2000

                case %csrlin>42:cls'locate 4,1
                x&=%csrlin:y&=%pos:locate 2,1
                print " Sollwert: ";sn&*v!;"    Zwischenstand: ";int(sn&*z&);" / ";n&,"         ";
                locate x&,y&:tm&=&gettickcount
                waitinput 1

            endif

        endwhile

        print mkstr$("-",77):beep
        print " your gesuchter worth ";sn&*v!;" becomes with max. ";st&;"-stelligem denominator "
        print " by the fraction ";int(sn&*z_&);" / ";n_&;

        if err_!<>0:print " best possible approach!"

            else :print " exakt displayed!"

        endif

        print mkstr$("-",77)
        print "\n Nochmal? [n,n =Ende]: ";:input c$
        casenot left$(trim$(lower$(c$)),1)="n":goto "nochmal"
        END
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/11/21  
 



Zum Experiment


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

494 Views

Untitledvor 0 min.
Stringray01/05/22
Ernst07/21/21
p.specht06/17/21
Uwe ''Pascal'' Niemeier06/13/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (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