A test of your understanding of Maths

Post/Author/DateTimePost
#1

yellowdingo

Aug 10, 2008 20:02:56
2158/148=?

method A
148|2158
14r86============>14.
148|86
0r86=============>0
148|860
5r120============>5
148|120
0r120============>0
148|1200
8r16=============>8
148|16
0r16=============>0
148|160
1r12=============>1
148|12
0r12=============>0
148|120
0r120=recurring series

2158/148=14.05{08010}

method b
aka microsoft calculator
2158/148=14.5{810}

which method is correct and why?
#2

pigknight

Aug 10, 2008 23:31:26
My head! IT HURTZ!!11!1!!1!1!one!11shiftone!1!
#3

dispaminite

Aug 10, 2008 23:44:47
Why wouldn't you just use method B?
#4

farmer42_dup

Aug 11, 2008 1:35:32
The second. In the first one, when you get the 860, you're adding a 0 and moving the decimal point, but if you actually write the math out, it looks like this:

......0014.5...
148)2158.0
......148
......0670
......0592
......00780
......00740
etc.
#5

dalzig

Aug 11, 2008 2:45:44
Method C:
2158/148 = 14

:whatsthis
#6

Crimson_Concerto

Aug 11, 2008 2:47:45
. . . The second one because the first one makes no sense whatsoever. WTF are you even doing in that first one? Is this some freaky internet notation for something that's a lot simpler when you write it on paper?

EDIT:
2158/148 = 14

:whatsthis

Uh... what? No.
#7

dalzig

Aug 11, 2008 2:49:14
Method A is your standard long division, just written like a chan-ner would probably write it. ;)
#8

Crimson_Concerto

Aug 11, 2008 2:50:14
Method A is your standard long division, just written like a chan-ner would probably write it. ;)

WTF is a chan-ner?
#9

dalzig

Aug 11, 2008 2:55:46
WTF is a chan-ner?

Aw, I probably shouldn't have put the '-' in there. A channer is a person who frequents imageboard sites such as 4chan, 7chan, 12chan, and pretty much any website with the suffix -chan.

I'll spare you the details if you don't know. [Wikipedia Link]

Uh... what? No.

Well, seeing as how we are dealing with two integers, and the OP has failed to declare them as anything but integers, I assumed we were doing Integer Division. The result of Integer Division must be an integer, therefore the answer is 14. [Non-programmers/math nerds need not apply.]
#10

Crimson_Concerto

Aug 11, 2008 3:14:36
Aw, I probably shouldn't have put the '-' in there. A channer is a person who frequents imageboard sites such as 4chan, 7chan, 12chan, and pretty much any website with the suffix -chan.

Oh, those. No, no, I know what those places are. I wish I didn't, but I do.

Well, seeing as how we are dealing with two integers, and the OP has failed to declare them as anything but integers, I assumed we were doing Integer Division. The result of Integer Division must be an integer, therefore the answer is 14. [Non-programmers/math nerds need not apply.]

. . . Unless you plan on further explaining this, it's wrong.
Just because one is dividing two integers doesn't in any way mean integer division is the specific intent...

EDIT: To make my point more clear, what you claim is tantamount to suggesting that we are dealing with two real numbers, and that the OP has failed to declare them as anything but real numbers, so the result must therefore be a real number... Oh wait...
#11

dalzig

Aug 11, 2008 3:22:15
#include<br /> using std::cout;<br /> <br /> int main(){<br /> int firstNum = 2158;<br /> int seconNum = 148;<br /> cout &lt;&lt; firstNum / seconNum;<br /> }
#12

Crimson_Concerto

Aug 11, 2008 3:33:16
Result will be 14.

And wrong.

Yes, it is assumed that in everyday language division of two numbers means real number division, but as a programmer you never assume anything.

You mean like how you assumed we were engaging in "integer division"? :P
#13

dalzig

Aug 11, 2008 3:40:50
You mean like how you assumed we were engaging in "integer division"? :P

Err, you assume I passed my English classes because I'm good at thinking about what I write. :D

TBH, I was just trying to make a geeky joke. I'm sorry.
#14

encara

Aug 11, 2008 13:54:31
And wrong mathematically.

Fixed.

While his math in the OP is flawed (in method A), it's is correct that Integer Division in programming will have that result.

In fact, some programs rely on Integer Division's truncations as a floor function (round down).
#15

_jayne_cobb_

Aug 11, 2008 14:13:08
42
#16

pigknight

Aug 11, 2008 16:37:40
^Win.
#17

maulorn

Aug 11, 2008 19:40:24
There is no such thing as division!

Just multiplication of reciprocals.