Skip to content

Commit

Permalink
rpn 6.2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ConceptJunkie committed Mar 30, 2015
1 parent c5f7c15 commit 7073362
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 33 deletions.
1 change: 1 addition & 0 deletions buildRPN.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ iff %_X64 eq 1 then
"%PROG32_DIR%\Inno Setup 5\ISCC.exe" rpn64.iss
move Output\setup_rpn.exe "%RPN_TARGET%\setup_rpn-%VERSION%-win64.exe"
else
copy msvcp100-win32.dll build\exe.win32-3.4\msvcp100.dll
"%PROG32_DIR%\Inno Setup 5\ISCC.exe" rpn32.iss
move Output\setup_rpn.exe "%RPN_TARGET%\setup_rpn-%VERSION%-win32.exe"
endiff
Expand Down
27 changes: 17 additions & 10 deletions makeHelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,12 @@
'cube' simply returns the value of n to the third power.
''',
'''
''' ],
'debruijn' : [
'combinatorics', 'generates a deBruijn sequence of n symbols and word-size k',
'''
''',
'''
''' ],
'decagonal' : [
'polygonal_numbers', 'calculates the nth decagonal number',
Expand Down Expand Up @@ -3503,7 +3509,7 @@
'''
''' ],
'plot' : [
'special', 'plot function a for values of x between b and c',
'special', 'plot function c for values of x between a and b',
'''
'plot' is very much considered experimental. It's easy to construct an
incompletely-defined function and cause mpmath to go into an infinite loop.
Expand All @@ -3515,9 +3521,17 @@
a number of extra libraries.
''',
'''
c:\>rpn 0 pi x sin plot
c:\>rpn -5 5 x 4 ** 3 x 3 ** * + 25 x * - plot
c:\>rpn 1 50 x fib plot
c:\>rpn 1 10 x 1 + fib x fib / plot
''' ],
'plot2' : [
'special', '3D plotting, w00t!'
'special', 'plot a 3D function '
'''
'plot2' is very much considered experimental.
Expand All @@ -3529,16 +3543,9 @@
a number of extra libraries.
''',
'''
c:\>rpn 0 pi x sin plot
c:\>rpn -5 5 x 4 ** 3 x 3 ** * + 25 x * - plot
c:\>rpn 1 50 x fib plot
c:\>rpn 1 10 x 1 + fib x fib / plot
''' ],
'plotc' : [
'special', 'plot a complex function a for values of x between a and b real, c and d imaginary',
'special', 'plot a complex function e for values of x between a and b real, c and d imaginary',
'''
'plotc' is very much considered experimental.
Expand Down
50 changes: 31 additions & 19 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,12 @@ units program.

****

update 2015-02-17:

I haven't updated the Windows installer in a while because I introduced the
ability to access mpmath's plotting component in 6.2.0. However, this means I
need to bring a metric ton of more libraries for the Windows installer.

I haven't decided how to address that because the plotting functionality is
very elementary at this point. I hate the idea of bloating up the install with
tons of stuff for a feature that is of peripheral utility (outside of high
school algebra homework).

On the other hand, there have been some important bug fixes recently, and more
needed.

****

The current version is 6.1.0.
The current version is 6.2.0.

Installers for Windows can be found here:

https://www.strongspace.com/conceptjunkie/public/setup_rpn-6.1.0-win32.exe
https://www.strongspace.com/conceptjunkie/public/setup-rpn-6.1.0-win64.exe
https://www.strongspace.com/conceptjunkie/public/setup_rpn-6.2.0-win32.exe
https://www.strongspace.com/conceptjunkie/public/setup-rpn-6.2.0-win64.exe

rpn is a console app and can be launched from the command-line. However,
there is now an "interactive mode" and an icon to launch rpn for Windows users.
Expand Down Expand Up @@ -109,6 +93,34 @@ p.s. rpn is licensed under the GNU GPL version 3.0. See (see

Release Notes:

6.2.0

Experimental support for mpath plotting functionality using the new
operators, 'plot', 'plot2', 'plotc'. These operators are not supported
in the Windows installer.

'quit' is now an alias for 'exit' in interactive mode and help mode.

Improvements in function definition. 'y' and 'z' are now operators, allowing
for defining functions on 2 or 3 variables.

Operators 'eval2' and 'eval3' allow for evaluation of 2 and 3 variable
operators.

rpn now throws an error if a user-defined function is invalidly specified,
instead of going into an infinite loop.

'filter' allows filtering a list based on a user-defined function.

If the units in a measurement cancel out, then the measurement is converted
back to a numerical value.

Added 'rand_' and 'randint_' operators.

Added the 'debruijn' operator.

Fixed several minor bugs.

6.1.0

New operators: 'maxdouble', 'maxfloat', 'mindouble', 'minfloat'
Expand Down
33 changes: 33 additions & 0 deletions rpnCombinatorics.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,36 @@ def getNthSylvester( n ):
return list[ -1 ]


# //******************************************************************************
# //
# // createDeBruijnSequence
# //
# //******************************************************************************

def createDeBruijnSequence( n, k ):
wordSize = int( k )
symbolCount = int( n )

v = [ 0 for _ in range( wordSize ) ]
l = 1
result = [ ]

while True:
if wordSize % l == 0:
result.extend( v[ 0 : l ] )

for i in range( l, wordSize ):
v[ i ] = v[ i - l ]

l = wordSize

while l > 0 and v[ l - 1 ] >= symbolCount - 1:
l-=1

if l == 0:
break

v[ l - 1 ] += 1

return result

1 change: 1 addition & 0 deletions rpnOperators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ def setIdentifyMode( ):
'ctriangular' : OperatorInfo( lambda n: getCenteredPolygonalNumber( n, 3 ), 1 ),
'ctriangular?' : OperatorInfo( lambda n: findCenteredPolygonalNumber( n, 3 ), 1 ),
'cube' : OperatorInfo( lambda n: exponentiate( n, 3 ), 1 ),
'debruijn' : OperatorInfo( createDeBruijnSequence, 2 ),
'decagonal' : OperatorInfo( lambda n: getNthPolygonalNumber( n, 10 ), 1 ),
'decagonal?' : OperatorInfo( lambda n: findNthPolygonalNumber( n, 10 ), 1 ),
'december' : OperatorInfo( lambda: 12, 0 ),
Expand Down
11 changes: 7 additions & 4 deletions rpnOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,14 @@ def printOperatorHelp( term, operatorInfo, operatorHelp ):
else:
print( operatorHelp[ 2 ] )

if operatorHelp[ 3 ] == '' or operatorHelp[ 3 ] == '\n':
print( 'No examples are available.' )
if len( operatorHelp ) > 3:
if operatorHelp[ 3 ] == '' or operatorHelp[ 3 ] == '\n':
print( 'No examples are available.' )
else:
print( term + ' examples:' )
print( operatorHelp[ 3 ] )
else:
print( term + ' examples:' )
print( operatorHelp[ 3 ] )
print( 'No examples are available.' )


# //******************************************************************************
Expand Down
2 changes: 2 additions & 0 deletions testRPN.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@ def runTests( ):
testRPN( 'rpn 2015 20 thursday nthweekdayofyear' )
testRPN( 'rpn 2015 -1 thursday nthweekdayofyear' )

testRPN( 'rpn 4 3 debruijn' )

testRPN( 'rpn help' )
testRPN( 'rpn help about' )
testRPN( 'rpn help arithmetic' )
Expand Down

0 comments on commit 7073362

Please sign in to comment.