Define a constant that mimics the behavior of internal constants
Subject: Define a constant that mimics the behavior of internal constants
From: Luj Omu
Date: Wed, 25 Sep 2013 14:49:07 +0200
Hello,
I'd like to replicate the behavior of built-in constants like %pi or %e
for custom constants. I.e. the constant should be displayed as a symbol
by default and only be substituted by its numeric value upon request.
E.g. for the custom constant %2pi = 2*%pi:
The line "3 * %2pi;" should result in "3 %2pi;" and not in "6 %pi;".
The line "3 * %2pi, numer;" should result in "18.84955592153876".
The line "sin( %2pi);" should result in "0".
I guess another way to frame this question would be: Where and how are
the internal constants defined?
Thanks!
Luj Omu