Page 1 of 2

I just realized fhat programming is just all math...

Posted: Tue May 26, 2009 7:23 pm
by davidthefat
LOL today we learned functions and mapping in Geometry today, and it looked just like C++ functions and arguments...

Geometry/Algebraic Function:
f(x)=3x+10
x = 10

3(10)+10
C++
void function(int x)
{
x = 3 * x + 10;
};


Interesting... :lol: :lol: :lol: :lol:

Re: I just realized fhat programming is just all math...

Posted: Tue May 26, 2009 8:26 pm
by Moosader
Was today your first day in Algebra or something? o_O

Re: I just realized fhat programming is just all math...

Posted: Tue May 26, 2009 9:15 pm
by Falco Girgis
Pre algebra?

Re: I just realized fhat programming is just all math...

Posted: Tue May 26, 2009 10:07 pm
by davidthefat
Moosader wrote:Was today your first day in Algebra or something? o_O
Geometry, and last few weeks of it too :lol:

Re: I just realized fhat programming is just all math...

Posted: Tue May 26, 2009 10:18 pm
by Bakkon
pretty fhat bro

Re: I just realized fhat programming is just all math...

Posted: Wed May 27, 2009 10:12 am
by K-Bal
Your function would not make any difference because you don't use a reference or pointer and you are not returning anything ;)

Re: I just realized fhat programming is just all math...

Posted: Wed May 27, 2009 12:58 pm
by LuciDreamTheater
I just learned about another link between math and programming too:

In my C++ class back in '07, when talking about cin and cout, my professor mentioned something called a source and a sink. Oddly enough, in my vector calculus class, when we talked about vector fields, the terms source and sink were also used. There really is a strong connection between the two fields, probably more than you even realize.

Re: I just realized fhat programming is just all math...

Posted: Wed May 27, 2009 8:16 pm
by davidthefat
K-Bal wrote:Your function would not make any difference because you don't use a reference or pointer and you are not returning anything ;)
I thought you dont have to return anything if its void?

Re: I just realized fhat programming is just all math...

Posted: Wed May 27, 2009 8:55 pm
by Falco Girgis
davidthefat wrote:
K-Bal wrote:Your function would not make any difference because you don't use a reference or pointer and you are not returning anything ;)
I thought you dont have to return anything if its void?
The point is that mathematical functions have return values.

When you graph a function of one variable, you're saying y = f(x). So f(x) must return something.

Re: I just realized fhat programming is just all math...

Posted: Wed May 27, 2009 9:00 pm
by Bakkon
davidthefat wrote:
K-Bal wrote:Your function would not make any difference because you don't use a reference or pointer and you are not returning anything ;)
I thought you dont have to return anything if its void?
Though it's not a very useful function in it's current state.

Code: Select all

#include <iostream>
using namespace std;

int main()
{
   cout << "Solve for f(x) when x = 5." << endl;
   cout << funcMe(5) << endl;

   return 0;
}

int funcMe(int x)
{
   return 3 * x + 10;
}
K-Bal was saying it would do nothing to the remainder of the program as the solution would disappear after leaving the scope of the function. ;)

Re: I just realized fhat programming is just all math...

Posted: Thu May 28, 2009 3:33 pm
by MarauderIIC
Yeah I can double-major in CS and math with like three more classes.

Re: I just realized fhat programming is just all math...

Posted: Sun May 31, 2009 1:46 am
by dejai
Kinda off topic but it is so weird to me how yanks call it math. When did you guys drop the plural? Its called Mathematics after all it would sound absurd to call it Mathematic. I suppose its a bit like an conversion from a double to an int you just lose all decimal points.

Re: I just realized fhat programming is just all math...

Posted: Sun May 31, 2009 11:58 am
by wtetzner
dejai wrote:Kinda off topic but it is so weird to me how yanks call it math. When did you guys drop the plural? Its called Mathematics after all it would sound absurd to call it Mathematic. I suppose its a bit like an conversion from a double to an int you just lose all decimal points.
Hmm, I always thought math was short for mathematics. Mathematic is an adjective, not the singular form of mathematics (http://dictionary.reference.com/browse/mathematic).

Re: I just realized fhat programming is just all math...

Posted: Sun May 31, 2009 4:17 pm
by Bakkon
dejai wrote:Kinda off topic but it is so weird to me how yanks call it math. When did you guys drop the plural? Its called Mathematics after all it would sound absurd to call it Mathematic. I suppose its a bit like an conversion from a double to an int you just lose all decimal points.
Correct, it is a truncation. But when you truncate, you take off everything at the end, not all but one, right? ;)

Re: I just realized fhat programming is just all math...

Posted: Mon Jun 01, 2009 1:06 pm
by MarauderIIC
Except that truncation of a noun is a noun, and truncation of an adjective is an adjective. And since math is a truncation of mathematics, not a truncation of mathematical (mathematic seems to only be a word according to some), it's a noun.