programming n00b

Zanix

Diamond Member
Feb 11, 2003
5,568
12
81
I can't find out what this equation gives:

9 + 50 * (40 % (30 - 2) / 4) =

the register says 0x0000009f, but I can't figure out if that's right or not.

I don't know what the remainder of 30-2 and 40 should be...

Lil help guys?


:cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie::cookie:

TO ALL!!! WEEE!!
 

GigaCluster

Golden Member
Aug 12, 2001
1,762
0
0
Originally posted by: Zanix
I can't find out what this equation gives:

9 + 50 * (40 % (30 - 2) / 4) =

the register says 0x0000009f, but I can't figure out if that's right or not.

I don't know what the remainder of 30-2 and 40 should be...

Lil help guys?


9 + 50 * (40 % (30 - 2) / 4) =
9 + 50 * (40 % 28 / 4) =
9 + 50 * (12 / 4) =
9 + 50 * 3 =
9 + 150 =
159
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
> don't know what the remainder of 30-2 and 40 should be...

You don't understand the "mod" operator? That's not goovy.

You should also look up the precedence rules for your language to see whether you need to be computing
a. (40 % 28 ) /4
b. 40 % (28 / 4)
Since they give different answers.

RTFM or Google is your only hope.
 

MAME

Banned
Sep 19, 2003
9,281
1
0
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now
 

Zanix

Diamond Member
Feb 11, 2003
5,568
12
81
Originally posted by: DaveSimmons
> don't know what the remainder of 30-2 and 40 should be...

You don't understand the "mod" operator? That's not goovy.

You should also look up the precedence rules for your language to see whether you need to be computing
a. (40 % 28 ) /4
b. 40 % (28 / 4)
Since they give different answers.

RTFM or Google is your only hope.

It's a. No I didn't understand the mod operator. It's called REM in MIPS and I wasn't sure if it was used the same.

Thanks for the help.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,202
126
Originally posted by: DaveSimmons
> don't know what the remainder of 30-2 and 40 should be...

You don't understand the "mod" operator? That's not goovy.

You should also look up the precedence rules for your language to see whether you need to be computing
a. (40 % 28 ) /4
b. 40 % (28 / 4)
Since they give different answers.

RTFM or Google is your only hope.

Yes. That's one of the few things that I got wrong in an intro programming class in 'C' once.. forgot how the integral "mod" operator performed with negative values. (Not shown in the example.) Since I don't normally use it that way, I figure I'm safe.
 

Zanix

Diamond Member
Feb 11, 2003
5,568
12
81
Originally posted by: MAME
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now

You little dildo.
 

Zim Hosein

Super Moderator | Elite Member
Super Moderator
Nov 27, 1999
65,172
399
126
Originally posted by: Zanix
Originally posted by: MAME
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now

You little dildo.

If someone was going to be a dildo, why would the be little? :p
 

Zanix

Diamond Member
Feb 11, 2003
5,568
12
81
Originally posted by: Zim Hosein
Originally posted by: Zanix
Originally posted by: MAME
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now

You little dildo.

If someone was going to be a dildo, why would the be little? :p

Maybe if they are ineffective at stimulating properly.
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Originally posted by: Zanix
Originally posted by: MAME
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now

You little dildo.

he's right.
 

Zanix

Diamond Member
Feb 11, 2003
5,568
12
81
Originally posted by: tfinch2
Originally posted by: Zanix
Originally posted by: MAME
Originally posted by: Zanix
Originally posted by: Zanix
Originally posted by: tfinch2
159

Now how did ya get that answer?

F'it, good enough for me, HW done! woo!


ZIM! Beer me!


edit: if only fake life was as real as real life....

are you kidding me? if you can't understand this horribly easy problem, you need to drop out of programming now

You little dildo.

he's right.

Alright, I asked for help with a math problem, not with life choices.

I apreciate your help.

I admitted in the title that I may be a beginer. I don't need crass reminders.