-
[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 :D)
Please keep it serious. Thanks.
-
Re: [Serious - programming] I need ideas for program features
-
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 :)
-
Re: [Serious - programming] I need ideas for program features
-
Re: [Serious - programming] I need ideas for program features
-
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.
-
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
-
Re: [Serious - programming] I need ideas for program features
nPr and nCr?
Binomial coefficients?
-
Re: [Serious - programming] I need ideas for program features
Quote:
Originally Posted by zaza
nPr and nCr?
Excellent ideas.
-
Re: [Serious - programming] I need ideas for program features
-
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.
-
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.
-
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]
-
Re: [Serious - programming] I need ideas for program features
-
Re: [Serious - programming] I need ideas for program features
Quote:
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);
-
Re: [Serious - programming] I need ideas for program features
How about...
BCD conversion
Binary rotate
Any good?
-
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
-
Re: [Serious - programming] I need ideas for program features
imaginary number support:
square root(negative i) = 0.707106781 - 0.707106781 i
-
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.
-
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...
-
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.
-
Re: [Serious - programming] I need ideas for program features
∫ and ∂
...Have fun with those!
-
Re: [Serious - programming] I need ideas for program features
Seriously though, sinh, cosh, tanh, sec, csc, cot, sech, csch, coth
-
Re: [Serious - programming] I need ideas for program features
Uniary RangeSum(Low,High)
-
Re: [Serious - programming] I need ideas for program features
RangeSum(Low,High,Sequence())
-
Re: [Serious - programming] I need ideas for program features
RangeSum(Low,High,NumberSet())
-
Re: [Serious - programming] I need ideas for program features
CountOfNumbersInRange(Low,High,NumberSet())
-
Re: [Serious - programming] I need ideas for program features
Given 3 points...
And a 4th...
Is the 4th inside, or outside the 3?
-
Re: [Serious - programming] I need ideas for program features
All functions in Calculous.
I hate it.
-
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))
-
Re: [Serious - programming] I need ideas for program features
Quote:
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?
-
Re: [Serious - programming] I need ideas for program features
Quote:
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...
-
Re: [Serious - programming] I need ideas for program features
Definite integration, indefinite would be rather hard. Then derivation would be nice =)
-
Re: [Serious - programming] I need ideas for program features
Quote:
Originally Posted by dsheller
Definite integration, indefinite would be rather hard. Then derivation would be nice =)
I stated those already!
-
Re: [Serious - programming] I need ideas for program features
Quote:
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.
Quote:
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 :)
-
Re: [Serious - programming] I need ideas for program features
-
Re: [Serious - programming] I need ideas for program features
change between different bases... (binary, oct, and hex at first)
-
Re: [Serious - programming] I need ideas for program features
Something to convert decimal to fraction?
Using x^2? (the ^ bit)
Degrees, Radian?
-
Re: [Serious - programming] I need ideas for program features
Quote:
Originally Posted by kregg
Using x^2? (the ^ bit)
thats what the pow() function's for. ("^" has its own meaning in boolean/bitwise operations)
Quote:
Originally Posted by kregg
Degrees, Radian?
Done:
dxr() degrees to radians
rxd() radians to degrees
everyone: See the first post again.
-
Re: [Serious - programming] I need ideas for program features
Split into prime factors?
Quadratic equation solver (given coefficients)?
Cubic....? :)