Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

NEED URGENT HELP

Name: edo-chan 2011-12-28 11:11

sup /prog/

Ive asked this everywer already but peopl seem too lame to make even a simple program like so i hope the mighty anon programers of 4chan are more skilled

what im trying to do is to Write a method taking two parameters x and n that computes the nth power of x without using ^ or declaring a new variable inside the method or using Math lib.
and it has to be coded in JAVA (i know it sux but dont ask why i use dat shit)
hep plox!

Name: Anonymous 2011-12-29 17:04

Kodak-san would you like to receive a Photo Book created with Smart Fit technology as a gift?

Name: Anonymous 2011-12-29 17:05

>>120

[ Thu Dec 29 05:04:42 ]
[ @ ~/host/prog ] $ java pow 2 10000
FOR:0.0
REC:Infinity



I have a feeling you don't know what causes stack overflows to begin with to even make you think pow(2,560) would overflow

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:05

>>120
As i have mentioned here please note for further engagement
>>108

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:07

I don't think that pow(2,560) would overflow
I think that a recursive function that was described during the conversation with x = 2 and n = 560 would overflow

Name: Anonymous 2011-12-29 17:08

>>124
It wouldn't, you're wrong, go back to your imageboards faggot and act like you know shit that you don't.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:10

>>125
... you realllllllllllly don't think that a RECURSIVE function looping on itself 560 times wouldn't overflow?

Name: Anonymous 2011-12-29 17:11

>>102
This epic failure has been archived.

Name: Anonymous 2011-12-29 17:11

>>126
LOL!s

Name: Anonymous 2011-12-29 17:12

>>126
Java uses a fucking VM where a stack frame takes like 2 bytes YOU STUPID FAGGOT!!

Name: Anonymous 2011-12-29 17:12

>>126
see >>120

public static double powr(int x,int n)
    {
        if(x == 1 || n == 0) return 1.0;
        return n < 0 ? (1.0/(powr(x,-n-1)*x)) : powr(x,n-1)*x;
    }

[ Thu Dec 29 05:04:42 ]
[ @ ~/host/prog ] $ java pow 2 10000
FOR:0.0
REC:Infinity
[ Thu Dec 29 05:00:02 ]
[ @ ~/host/prog ] $ java pow 2 560
FOR:0.0
REC:3.7739624248215414E168


you're retarded

Name: Anonymous 2011-12-29 17:14

>>119
Something like Netbeans isn't an editor alone. It's an editor, a compiler, a debugger, and a few other things. The fact that you keep saying it's an editor reflects that fact you are in fact stupid.

Also, there are other editors besides notepad. So again, you're stupid. And again, you have no real future a computer programmer.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:14

>>130
Because you can't read ill type REAL SLOW...
That code is OBVIOUSLY WRONG... I discovered this when i went to get cookies... I fixed but DIDN'T repost it... would you like the fixed version???

Name: Anonymous 2011-12-29 17:15

>>132
Something like Netbeans isn't an editor alone. It's an editor, a compiler, a debugger, and a few other things. The fact that you keep saying it's an editor reflects that fact you are in fact stupid.

Also, there are other editors besides notepad. So again, you're stupid. And again, you have no real future a computer programmer.

Name: Anonymous 2011-12-29 17:16

>>132
No sir, you're retarded. >>130 had nothing to do with your shitty mistake. It was showing you that you're horribly wrong to think it would stack overflow with the recursive method.

Stop trying to go off topic back to your shitty mistake and just face the facts.

By the time the recursive function even does overflow you've gone before infinity anyway thus making it worthless to even complain about

Name: Anonymous 2011-12-29 17:17

>>133
You gonna be hella mad when you get an invite to check out Google in a couple of years.

Name: Anonymous 2011-12-29 17:18

>>134
before infinity
beyond*

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:18

>>131
I believe that i specified it as an IDE. i understand what netbeans is and know of its features especially because i have it open as i type...

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-12-29 17:18

>>134
I didn't that post the code you idiot. I was responding to the other idiot who thinks Netbeans is an editor (alone).

Name: Anonymous 2011-12-29 17:19

>>137
Yes, it's an IDE. What that means is that not only is it an editor, but also a compiler, and a debugger. What part of this don't you understand you fucking moron?

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:19

>>135
glad to see someone still has a sense of humour

Name: Anonymous 2011-12-29 17:20

In this thread, the users of prog expose how insecure they are by attempting to belittle a student programmer. Don't you know that this behavior is unscientific and ultimately unproductive?

Name: Anonymous 2011-12-29 17:21

>>137,138,140,143-1000
Get a room already you fucking faggots.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:21

>>138
i do apologize.. i have way too many people attacking me right now.. I didn't realize that you were having a side conversation

Name: Anonymous 2011-12-29 17:22

>>142
Let's just hope google doesn't ask him what an editor is -(.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-12-29 17:23

>>143
I was just pointing out one of your many vast misconceptions. Again, computer programming doesn't seem to be your thing.

Name: Anonymous 2011-12-29 17:23

>>141
It's only Kodak-san and some other random retard, Kodak belittles everyone since he's like 5 feet tall or something.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:23

>>144
ouch... So quick poll... Who doesn't like me and for what reason(s)
so that i may solve this arguement clusterfuck

Name: Anonymous 2011-12-29 17:25

>>134

using stack space when it isn't necessary is always a waste of space and time, and should always be considered sub optimal, even when you have enough resources to afford it without crashing.

Name: Anonymous 2011-12-29 17:25

>>147
Just stop talking to them.

Name: Anonymous 2011-12-29 17:27

>>138
why did you reply that to >>134 when 134 has no relation to you, it as pointed at IisMathwizard


Are you trolling?

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:27

>>149
kthen... so does this mean that the arguements have been resolved
?

Name: Anonymous 2011-12-29 17:29

>>151
Yes you are new to programming, everyone has been at some point. Everybody makes mistakes.

Name: Anonymous 2011-12-29 17:31

>>147

you've found a situation that is very common on the internet, and in the business world, and in academia, where people get off to acting like they know more than others about some kind of distinguished subject. Kudos on not playing into it yourself there friend. In this test, you have stayed committed to science!

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:31

>>152
alright then... One last call... anyone else want to say something  about my programming skill/ mother/ Google dream's/ n00b status/ my unemployment (ima student if you hadn't read the comment about it before)

Name: Anonymous 2011-12-29 17:31

>>148
argues stack overflow
proven wrong
now argues waste of space and time
you just can't seem to admit you're wrong can you?
the power recursive is just as fast as the iterative as well you can go time it yourself the difference is less than a few hundred milliseconds for powers up to 10000.

The fact that you're arguing over space is just funny. elegance solutions > shit code any day.

If the JVM supported tail recursive like other languages it wouldn't even be a problem since it would be OPTIMIZED

Name: Anonymous 2011-12-29 17:32

The jews are after me.

Name: Anonymous 2011-12-29 17:33

>>154
could you change your name to fit something that actually makes sense. You're clearly not good at math nor a wizard by any means.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:35

>>157
no... I am most doubtful of your demoting comment. I am quite good at mathematics thank you.
>>155
I think we went over this already so im not going to reiterate it for you.

Because this came up a few times...:

public class someClass{
    static int count = 0;
    static boolean neg = false;
    static int v = 1;
    public static void main(String[] args){
        System.out.println(powerUp((int) Integer.parseInt(args[0]),(int)Integer.parseInt(args[1])) + "");
        }
    public static double powerUp(int x, int n){
        count = 0;
        neg = false;
        if(n < 0){
            n = -1 *n;
            neg = true;
            }
        for(;count < n; count++){
            v = v * x;
            }
        if(neg){
            return (1/(double)v);
            }
        return v;
        }
    }

Name: Anonymous 2011-12-29 17:37

>>158
still trying to strawman off topic back to your mistake?
Please stop posting about it, no one has cared about it nor did we ask for you to show a correct solution.

Name: IisMathwizard !!b/mIEkVC6+3Cvk1 2011-12-29 17:43

bye then. Happy coding...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List