Tips for golfing in GolfScript
Rational / Float / Complex

I've read so many times that GolfScript has only integers that I started to believe it. Well, it's not true.

2-1? # Raise 2 to the power of -1. Result: 0.5
4-1? # Raise 4 to the power of -1. Result: 0.25
+    # Add. Result: 0.75


The output is

3/4


with the standard GolfScript interpreter and

0.75


on Web GolfScript.

Similar hacks allow to cast to Rational, Float or even Complex:

{-2.?./*}:rational
{2.-1??./*}:float
{-2.-1??./*}:complex