Best Language for Maths?
- bumcheekcity
-
bumcheekcity
- Member since: Jan. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
Simple question, which programming language that isn't 100% impossible to learn, is the best for calculating maths functions. Bearing in mind that I use PHP and ASP most of the time, i'm looking for something to calculate things like this:
<?php
$link = mysql_connect("localhost", "bumcheek_andreas", "andreas")
or die("Could not connect : " . mysql_error());
mysql_select_db("bumcheek_bumcheekcity") or die("Could not select database");
$n = 1;
while ($n < 40756)
{
$query = "SELECT * FROM euler45 WHERE `id` = $n";
$result = mysql_query($query);
$tri = mysql_result($result,0,"tri");
$query = "SELECT * FROM euler45 WHERE `pent` = $tri";
$result = mysql_query($query);
$num2 = mysql_num_rows($result);
$query = "SELECT * FROM euler45 WHERE `hex` = $tri";
$result = mysql_query($query);
$num3 = mysql_num_rows($result);
if (($num2==$num3) && ($num2==1))
{
echo "$n, triangle number $tri, is a solution.";
} else {
echo "$n, triangle number $tri, is not a solution";
}
$n++;
}
?>
a LOT faster than PHP and mySQL seem to be doing it, which is currently 'bloody slow'
I've had suggestions that I use C/C++, and people suggesting that I do the PHP/mySQL on my ownb machine, which I dont want to do. So, is there any language you would recommend to me to use?
- LordAba
-
LordAba
- Member since: Nov. 2, 2000
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 9/12/04 12:33 PM, bumcheekcity wrote: Simple question, which programming language that isn't 100% impossible to learn, is the best for calculating maths functions.
FORTRAN! I mean, it stands for formula translation, so you can't go wrong!
What may man within him hide, though angel on the outward side.
- BuRnBoY
-
BuRnBoY
- Member since: Feb. 29, 2004
- Offline.
-
- Forum Stats
- Member
- Level 13
- Blank Slate
maybe it's not such a good idea posting your MYSQL password in public.. just replace it with summin like "OMGsecret" or w/e.
- bumcheekcity
-
bumcheekcity
- Member since: Jan. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
Sorry i couldn't resist loging into his account.
Seriously buncheek, change your password.
-F-13
- Sir-Davey
-
Sir-Davey
- Member since: Jul. 9, 2001
- Offline.
-
- Forum Stats
- Supporter
- Level 19
- Blank Slate
- Locriology
-
Locriology
- Member since: Apr. 25, 2003
- Offline.
-
- Forum Stats
- Member
- Level 08
- Blank Slate
Well any language can do basic mathematical operations, so just use the easiest language. Something like Qbasic; it's fast and takes about 2 seconds to write a program.
- bumcheekcity
-
bumcheekcity
- Member since: Jan. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
At 9/12/04 03:31 PM, bumcheekcity wrote: Sorry i couldn't resist loging into his account.
Seriously buncheek, change your password.
-F-13
That is like, the billionth time I've done that. How do you log in to someone else's account in phpMyAdmin or something?
- schorhr
-
schorhr
- Member since: May. 28, 2002
- Offline.
-
- Forum Stats
- Member
- Level 11
- Blank Slate
Well, write a php script or use phpmyadmin to access it :)
Anyway, installing php localy with www.xampp.org is a nice way.
- bumcheekcity
-
bumcheekcity
- Member since: Jan. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
yeah, ive had 'ol Bummy's password for a while now...
;) but leave it how it is, we all like it :-)
- Taylor
-
Taylor
- Member since: Aug. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
At 9/13/04 07:20 PM, bumcheekcity wrote: yeah, ive had 'ol Bummy's password for a while now...
;) but leave it how it is, we all like it :-)
OMG I ARE A HAX0R!!!
- Sar-Casm
-
Sar-Casm
- Member since: Dec. 13, 2002
- Offline.
-
- Forum Stats
- Member
- Level 08
- Blank Slate
Realistically something like C/C++ is the best you'll get. Although there certainly are better languages for the job, they just don't have implementation/documentation to be viable. Functional programming languages are not necessarily better overall in mathematics because they still use the same 'object-level' (not to be confused with object-oriented programming) system as with any imperative language.
- Wonderer
-
Wonderer
- Member since: Nov. 29, 2003
- Offline.
-
- Forum Stats
- Member
- Level 04
- Blank Slate
- Sir-Davey
-
Sir-Davey
- Member since: Jul. 9, 2001
- Offline.
-
- Forum Stats
- Supporter
- Level 19
- Blank Slate
At 9/14/04 06:02 AM, Wonderer wrote: what the hell is this about?
lol
Look you asshole.
This is lkike the 3rd time you come randomly and ask "LOL WHAT IS THIS ABOUT?"
If you don't know what programming is, please go away as this is the PROGRAMMING forum.
- Amish
-
Amish
- Member since: Mar. 13, 2003
- Offline.
-
- Forum Stats
- Member
- Level 16
- Blank Slate
Yeah what f13 siad. IN short and sweet.
Stop spamming. And go away
- bumcheekcity
-
bumcheekcity
- Member since: Jan. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 27
- Blank Slate
I've had the same password for ABSOLUTELY EVERYTHING for AGES now... And now I gotta change it for NG. *Shrugs* Either way, thanks, Earfetish.
- liljim
-
liljim
- Member since: Dec. 16, 1999
- Offline.
-
- Send Private Message
- Browse All Posts (11,644)
- Block
-
- Forum Stats
- Staff
- Level 28
- Blank Slate
At 9/12/04 12:33 PM, bumcheekcity wrote: a LOT faster than PHP and mySQL seem to be doing it, which is currently 'bloody slow'
I'm not surprised it's going slow, with over 120,000 queries per execution. Give us some examples of the data in your tables and where they should match - I wouldn't be questioning the speed of php/mysql in all of this, I'd first look into your own logic. I'm willing to bet there's probably a way of getting all of those queries down to just one (or, at the very most, a few).
- CronoMan
-
CronoMan
- Member since: Jul. 19, 2004
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
At 9/12/04 12:33 PM, bumcheekcity wrote:
:blah blah bla...Bearing in mind that I use PHP and ASP most of the time, i'm looking for something to calculate things like this:
Why the fuck are you using a server-side scripting language for maths? Probably the stupidest thing I've ever seen.
For maths only, try Mathematica.
"no sound in ass"

