Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Maths with notepad

Options
  • 18-02-2016 11:48pm
    #1
    Site Banned Posts: 20


    >open notepad
    >type x=
    >replace x with ((x+2/x)/2) 7 times
    >replace x with 1
    >copy whole text and paste into calculator

    Edit: Make sure you use "replace all".


Comments

  • Site Banned Posts: 20 Oros


    Anyone got any more? Can you calculate pi like this?


  • Site Banned Posts: 20 Oros


    This works in windows calculator set to radians.

    >type x=
    >replace x with (x+xs) 5 times or more
    >replace x with 1
    >paste into calculator


  • Registered Users Posts: 78,308 ✭✭✭✭Victor


    Oros wrote: »
    >open notepad
    >type x=
    >replace x with ((x+2/x)/2) 7 times
    >replace x with 1
    >copy whole text and paste into calculator


    If I use 'replace', I'm getting:
    ((((((1+2/1)/2)+2/((1+2/1)/2))/2)+2/((((1+2/1)/2)+2/((1+2/1)/2))/2))/2)=0.8359375

    If I use 'replace all', I'm getting
    ((((((((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2)+2/((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2))/2)+2/((((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2)+2/((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2))/2))/2)+2/((((((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2)+2/((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2))/2)+2/((((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2)+2/((((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2)+2/((((((x+2/x)/2)+2/((x+2/x)/2))/2)+2/((((x+2/x)/2)+2/((x+2/x)/2))/2))/2))/2))/2))/2))/2)=0.010075192...

    What am I missing?


  • Site Banned Posts: 20 Oros


    Yeah, use replace all. In the last attempt you haven't replaced x with 1.


  • Registered Users Posts: 78,308 ✭✭✭✭Victor


    Oros wrote: »
    Yeah, use replace all. In the last attempt you haven't replaced x with 1.

    You're right. :embarrassed:

    0.05314798...?


  • Advertisement
  • Site Banned Posts: 20 Oros


    Strange. What calculator are you using? It works ok with windows calculator.

    Maybe you need some extra parentheses. Try using ((x+(2/x))/2).


  • Registered Users Posts: 78,308 ✭✭✭✭Victor


    calc.exe - the default calculator in Windows 7.

    What is the actual formula?


  • Site Banned Posts: 20 Oros


    I'm using win7 calculator too. This is what should happen:

    img.ie/images/2016/02/19/b525eefb0af5bbe3413613c2c17b0ca0.png


  • Site Banned Posts: 20 Oros


    This one's golden.

    start: x=
    replace term: (1+1/x)
    iterations: 15
    start value: 1


  • Registered Users Posts: 78,308 ✭✭✭✭Victor


    Oros wrote: »
    This one's golden.

    start: x=
    replace term: (1+1/x)
    iterations: 15
    start value: 1
    16?


  • Advertisement
  • Site Banned Posts: 20 Oros


    I dunno wtf you're doing wrong, m8.


  • Site Banned Posts: 20 Oros


    Have you got your replace function in regex mode?


Advertisement