Opened 13 years ago

Closed 13 years ago

#7945 closed enhancement (fixed)

[Patch] Add Factorial and cube root support to deskcalc

Reported by: jscipione Owned by: stippi
Priority: normal Milestone: R1
Component: Applications/DeskCalc Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Add support for factorials and cubed roots to ExpressionParser and thus to Deskcalc. To get a cubed root just do cbrt(expression) for example:

cbrt(27) = 3
cbrt(7) = 1.91293118277

To use the factorial functionality put a ! after the expression. Examples:

0! = 1
3! = 6
(2*4)! = 40320
exp(5)! = 2.277161E259
0.5-((0.5^3)/3!)+((0.5^5)/5!)-((0.5^7)/7!) = 0.47942553323412
pi! = 1.0876234426477

These are a couple of nice functions supported by MAPM that I wanted support for in Deskcalc.

Attachments (1)

Deskcalc_factorial_and_cbrt_1.diff (6.2 KB ) - added by jscipione 13 years ago.
Patch that Adds factorial and cube root support to Deskcalc. Try it out, it is fun!

Download all attachments as: .zip

Change History (4)

by jscipione, 13 years ago

Patch that Adds factorial and cube root support to Deskcalc. Try it out, it is fun!

comment:1 by jscipione, 13 years ago

patch: 01

comment:2 by stippi, 13 years ago

Patch looks perfect, thanks a lot!

If I don't get around to commit it soon, please someone do it for me.

comment:3 by stippi, 13 years ago

Resolution: fixed
Status: newclosed

Applied in hrev42690, thanks a bunch!

Note: See TracTickets for help on using tickets.