|
-
Mar 9th, 2007, 02:36 PM
#1
[Serious - programming] I need ideas for program features
I'm writing a command line app that solves mathematical equations.
I need you guys to tell me what kind of math operators you would like to have in such a program. I've already covered most of the obvious ones (plus, minus, divide etc.)...
Code:
Supported Operators (token names only, use -L switch to get verbose info):
------------------------------------------------------------------------------------
+ - * / < > == != <= >=
<< >> neg int abs sign mod pow sin cos
tan ln log exp asin acos atan sqrt && ||
^^ ~~ imp eqv min max rint rand sum prod
gcd mean stdv dump count swap swlt swgt fact ?
npr ncr
If any of you boffins can see anything that I've missed out on this list (that you would expect / want / think is cool) then please let me know, I want this to be a good all-round math tool.
Any suggestions will get you a mention in the credits. I'm probably going to put this project up on sourceforge at some point (its ansi C++ so it'll compile on any platform )
Please keep it serious. Thanks.
Last edited by wossname; Mar 10th, 2007 at 09:20 AM.
I don't live here any more.
-
Mar 9th, 2007, 02:45 PM
#2
Fanatic Member
Re: [Serious - programming] I need ideas for program features
Using VB6 or VB.net 2008 with .net 3.5
"Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad
-
Mar 9th, 2007, 02:49 PM
#3
Re: [Serious - programming] I need ideas for program features
good points. I'll add "exp" too while i'm at it
edit: Ln(), Log() and Exp() done
Last edited by wossname; Mar 9th, 2007 at 02:56 PM.
I don't live here any more.
-
Mar 9th, 2007, 02:50 PM
#4
Re: [Serious - programming] I need ideas for program features
-
Mar 9th, 2007, 02:56 PM
#5
Re: [Serious - programming] I need ideas for program features
-
Mar 9th, 2007, 03:11 PM
#6
Re: [Serious - programming] I need ideas for program features
Mod() is in progress. Since I need to add an integer version and a floating point version.
There are some bitwise operators already (see the list) but more are on my todo list.
I don't live here any more.
-
Mar 9th, 2007, 03:13 PM
#7
I wonder how many charact
Re: [Serious - programming] I need ideas for program features
How about a command line that executes a shell command to open IE with Google calculator as the home page?
http://www.xnumber.com/google_calc.htm
-
Mar 9th, 2007, 03:15 PM
#8
Re: [Serious - programming] I need ideas for program features
nPr and nCr?
Binomial coefficients?
-
Mar 9th, 2007, 03:29 PM
#9
Re: [Serious - programming] I need ideas for program features
 Originally Posted by zaza
nPr and nCr?
Excellent ideas.
I don't live here any more.
-
Mar 9th, 2007, 03:40 PM
#10
Re: [Serious - programming] I need ideas for program features
-
Mar 9th, 2007, 04:06 PM
#11
Re: [Serious - programming] I need ideas for program features
See first post again to see the latest list. (I'll keep updating it as I add operators).
IsPrime() is a nice idea in theory, but for large numbers that would rapidly become slow. I'll probably put it in though.
I don't live here any more.
-
Mar 9th, 2007, 04:11 PM
#12
Re: [Serious - programming] I need ideas for program features
Awesome I've got 50 operators now! I want to make 100 if I can.
Keep the ideas coming.
I don't live here any more.
-
Mar 9th, 2007, 04:13 PM
#13
Re: [Serious - programming] I need ideas for program features
Code:
Financial Functions
DDB :: [Double Declining Balance]
FV :: [Future Value]
Ipmt :: [Interest Payment]
IRR :: [Internal Rate of Return]
Mirr :: [Modified Internal Rate of Return]
NPer :: [Number of Periods]
PMT :: [Payment]
PPMT :: [Principal Payment]
PV :: [Present Value]
Rate :: [Interest Rate Per Period]
SLN :: [Straight Line Depreciation]
SYD :: [Sum-of-Years Digits Depreciation]
Other
Hex :: [Hexadecimal]
Oct :: [Octal]
Rnd :: [Randomize]
Round :: [Rounds a floating point number]
-
Mar 9th, 2007, 04:15 PM
#14
Re: [Serious - programming] I need ideas for program features
-
Mar 9th, 2007, 04:28 PM
#15
Re: [Serious - programming] I need ideas for program features
 Originally Posted by sevenhalo
IsOdd()/IsEven()
Maybe later. as this can be done with bitwise operators (which I admittedly haven't finished yet).
IsOdd = (mynumber & 1);
I don't live here any more.
-
Mar 9th, 2007, 04:36 PM
#16
Re: [Serious - programming] I need ideas for program features
How about...
BCD conversion
Binary rotate
Any good?
-
Mar 9th, 2007, 04:53 PM
#17
Re: [Serious - programming] I need ideas for program features
I've thought about ROL and ROR (rotate left and rotate right) as per IA-32 assembler. however it will require a second operand to declare the width of the integral value being rotated.
No plans for BCD at the moment though. Its an arbitrary numeric encoding and as such doesn't fit the standard DAL/RPN model. maybe a future release
I don't live here any more.
-
Mar 9th, 2007, 04:54 PM
#18
Re: [Serious - programming] I need ideas for program features
imaginary number support:
square root(negative i) = 0.707106781 - 0.707106781 i
-
Mar 9th, 2007, 05:00 PM
#19
Re: [Serious - programming] I need ideas for program features
Reals only for the time being. Complex numbers are definitely on the agenda for 2.0 though.
I don't live here any more.
-
Mar 9th, 2007, 05:06 PM
#20
Re: [Serious - programming] I need ideas for program features
SumOfAll();
Like if you put in 13542
You get: 15
My ideas are only going to get worse...
-
Mar 9th, 2007, 05:10 PM
#21
Re: [Serious - programming] I need ideas for program features
Did that one a couple of days ago. Same with mean(), prod(), stdv() and so on.
I don't live here any more.
-
Mar 9th, 2007, 05:52 PM
#22
Hyperactive Member
Re: [Serious - programming] I need ideas for program features
∫ and ∂
...Have fun with those!
My monkey wearing the fedora points and laughs at you.
-
Mar 9th, 2007, 05:55 PM
#23
Hyperactive Member
Re: [Serious - programming] I need ideas for program features
Seriously though, sinh, cosh, tanh, sec, csc, cot, sech, csch, coth
My monkey wearing the fedora points and laughs at you.
-
Mar 9th, 2007, 08:34 PM
#24
Re: [Serious - programming] I need ideas for program features
Uniary RangeSum(Low,High)
-
Mar 9th, 2007, 08:35 PM
#25
Re: [Serious - programming] I need ideas for program features
RangeSum(Low,High,Sequence())
-
Mar 9th, 2007, 08:37 PM
#26
Re: [Serious - programming] I need ideas for program features
RangeSum(Low,High,NumberSet())
-
Mar 9th, 2007, 08:38 PM
#27
Re: [Serious - programming] I need ideas for program features
CountOfNumbersInRange(Low,High,NumberSet())
-
Mar 9th, 2007, 08:40 PM
#28
Re: [Serious - programming] I need ideas for program features
Given 3 points...
And a 4th...
Is the 4th inside, or outside the 3?
-
Mar 9th, 2007, 08:43 PM
#29
Fanatic Member
Re: [Serious - programming] I need ideas for program features
All functions in Calculous.
I hate it.
-
Mar 9th, 2007, 08:44 PM
#30
Re: [Serious - programming] I need ideas for program features
Given a set of N 2 dimensional points...SetOfPoints(N,1)
if p3 = F(p1,p2, cw, SetOfPoints)
Whats the next point(P3) clockwise from the 2nd point, nearest to the 2nd point, as you revolve from the first point?
CounterClockwise??? (p3 = F(p1,p2,ccw,SetOfPoints))
Last edited by NotLKH; Mar 9th, 2007 at 08:48 PM.
-
Mar 9th, 2007, 09:31 PM
#31
Re: [Serious - programming] I need ideas for program features
 Originally Posted by wossname
I've thought about ROL and ROR (rotate left and rotate right) as per IA-32 assembler.
I think you should add LOL and ROFL. Those would be pretty funny functions.
On a serious note, what do you have for constants? Pi and e are obvious ones, but are you thinking of other constants? I'm not quite sure how this will be used in the end, but for some types of practical applications, there are a variety of constants that could be of some value.
As an example, you talk about a math "solver". Does that mean that people might use it as some kind of glorified calculator for typed data? Would the conversion of inches to centimeters ever be of value?
My usual boring signature: Nothing
 
-
Mar 9th, 2007, 09:37 PM
#32
Re: [Serious - programming] I need ideas for program features
 Originally Posted by Shaggy Hiker
... Would the conversion of inches to centimeters ever be of value?
mArr() = CMYK(R,G,B)
mArr2() = RGB(C,M,Y,K)
Of course, for one of those, {Don't ask me ATM which,} you'll need another factor to input, to guide the desired "doping"
[is it 1:1 from cmyk to rgb? I think so..., but it's 1 to many from rgb to cmyk...
-
Mar 9th, 2007, 11:34 PM
#33
Fanatic Member
Re: [Serious - programming] I need ideas for program features
Definite integration, indefinite would be rather hard. Then derivation would be nice =)
"X-mas is 24.Desember you English morons.." - NoteMe
-
Mar 10th, 2007, 06:22 AM
#34
Hyperactive Member
Re: [Serious - programming] I need ideas for program features
 Originally Posted by dsheller
Definite integration, indefinite would be rather hard. Then derivation would be nice =)
I stated those already!
My monkey wearing the fedora points and laughs at you.
-
Mar 10th, 2007, 07:00 AM
#35
Re: [Serious - programming] I need ideas for program features
 Originally Posted by Shaggy Hiker
I think you should add LOL and ROFL. Those would be pretty funny functions.
On a serious note, what do you have for constants? Pi and e are obvious ones, but are you thinking of other constants? I'm not quite sure how this will be used in the end, but for some types of practical applications, there are a variety of constants that could be of some value.
Well I'm loading constants and variables from a text file so the user can use his own constants that suit his needs. This also decreases the number of searches that need to be done and increases efficiency.
 Originally Posted by Shaggy Hiker
As an example, you talk about a math "solver". Does that mean that people might use it as some kind of glorified calculator for typed data? Would the conversion of inches to centimeters ever be of value?
"typed data" is certainly the simplest way to use a command line app but you can also redirect the output of other programs into my program. A simple example:
Code:
./rpnsolve "`cat rpnsolver.cpp | wc` mean"
cat reads rpnsolver.cpp and pushes all the data through wc (word count) which returns a list of 3 numbers. This list is then fed into rpnsolve (my program) and its mean() function is called to take the average of those 3 numbers. The final result is (1133 + 3312 + 22369) / 3 == 8938.
Any program that outputs numeric data (either decimal or hex) to the console or to a file can be piped through my program and the data can be operated on.
Thats the general idea
Last edited by wossname; Mar 10th, 2007 at 07:14 AM.
I don't live here any more.
-
Mar 10th, 2007, 07:02 AM
#36
Re: [Serious - programming] I need ideas for program features
-
Mar 10th, 2007, 08:02 AM
#37
Hyperactive Member
Re: [Serious - programming] I need ideas for program features
change between different bases... (binary, oct, and hex at first)
-
Mar 10th, 2007, 09:19 AM
#38
Fanatic Member
Re: [Serious - programming] I need ideas for program features
Something to convert decimal to fraction?
Using x^2? (the ^ bit)
Degrees, Radian?
-
Mar 10th, 2007, 09:28 AM
#39
Re: [Serious - programming] I need ideas for program features
 Originally Posted by kregg
Using x^2? (the ^ bit)
thats what the pow() function's for. ("^" has its own meaning in boolean/bitwise operations)
 Originally Posted by kregg
Degrees, Radian?
Done:
dxr() degrees to radians
rxd() radians to degrees
everyone: See the first post again.
Last edited by wossname; Mar 10th, 2007 at 09:45 AM.
I don't live here any more.
-
Mar 10th, 2007, 09:49 AM
#40
Re: [Serious - programming] I need ideas for program features
Split into prime factors?
Quadratic equation solver (given coefficients)?
Cubic....?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|