Page 1 of 2 12 LastLast
Results 1 to 40 of 44

Thread: [Serious - programming] I need ideas for program features

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    [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.

  2. #2
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: [Serious - programming] I need ideas for program features

    What about log and ln?
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  3. #3

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  4. #4
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: [Serious - programming] I need ideas for program features

    How about Mod?
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


  5. #5
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [Serious - programming] I need ideas for program features

    bitwise operators?

  6. #6

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  7. #7
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    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

  8. #8
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: [Serious - programming] I need ideas for program features

    nPr and nCr?

    Binomial coefficients?
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  9. #9

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [Serious - programming] I need ideas for program features

    Quote Originally Posted by zaza
    nPr and nCr?
    Excellent ideas.
    I don't live here any more.

  10. #10
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [Serious - programming] I need ideas for program features

    IsPrime()?

  11. #11

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  12. #12

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  13. #13
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    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]

  14. #14
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [Serious - programming] I need ideas for program features

    IsOdd()/IsEven()

  15. #15

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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);
    I don't live here any more.

  16. #16
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: [Serious - programming] I need ideas for program features

    How about...

    BCD conversion
    Binary rotate


    Any good?
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


  17. #17

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  18. #18
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [Serious - programming] I need ideas for program features

    imaginary number support:
    square root(negative i) = 0.707106781 - 0.707106781 i

  19. #19

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  20. #20
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    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...

  21. #21

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  22. #22
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: [Serious - programming] I need ideas for program features

    and

    ...Have fun with those!
    My monkey wearing the fedora points and laughs at you.

  23. #23
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    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.

  24. #24

  25. #25

  26. #26

  27. #27

  28. #28

  29. #29
    Fanatic Member eSPiYa's Avatar
    Join Date
    Jun 2006
    Location
    in our house
    Posts
    751

    Re: [Serious - programming] I need ideas for program features

    All functions in Calculous.

    I hate it.

  30. #30
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    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))

  31. #31
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    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?
    My usual boring signature: Nothing

  32. #32
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    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...

  33. #33
    Fanatic Member
    Join Date
    Dec 2002
    Location
    North Carolina
    Posts
    734

    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

  34. #34
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    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!
    My monkey wearing the fedora points and laughs at you.

  35. #35

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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
    Last edited by wossname; Mar 10th, 2007 at 07:14 AM.
    I don't live here any more.

  36. #36
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [Serious - programming] I need ideas for program features

    imp and eqv.

  37. #37
    Hyperactive Member ZaNi's Avatar
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    360

    Re: [Serious - programming] I need ideas for program features

    change between different bases... (binary, oct, and hex at first)
    * Don't limit yourself to sanity
    * I'd rather be optimistic and naive than pessimistic and right
    * Ask good questions, get good answers.

    My Codebank submissions:
    How to write one rountine to handle many events
    Accessing and Using variables across multiple forms
    Printing/Previewing a form or control

    Links I've "borrowed" from other people:
    vbdotnetboy - Awesome site for tips

  38. #38
    Fanatic Member kregg's Avatar
    Join Date
    Feb 2006
    Location
    UK
    Posts
    524

    Re: [Serious - programming] I need ideas for program features

    Something to convert decimal to fraction?

    Using x^2? (the ^ bit)

    Degrees, Radian?

  39. #39

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.
    Last edited by wossname; Mar 10th, 2007 at 09:45 AM.
    I don't live here any more.

  40. #40
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: [Serious - programming] I need ideas for program features

    Split into prime factors?

    Quadratic equation solver (given coefficients)?
    Cubic....?
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width