Why pi is float at Mac, and expression elsewhere?

asked 2015-04-05 15:35:20 -0600

Mac OS X:

┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17                         │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: pi
3.141592653589793
sage: type(pi)
<type 'float'>
sage: a = pi + e*4/5; a
5.316218116357029
sage: a = 1 + 4/5; a
9/5

Linux (x86_64):

┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17                         │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage: pi
pi
sage: type(pi)
<type 'sage.symbolic.expression.Expression'>
sage: a = pi + e*4/5; a
pi + 4/5*e
sage: a = 1 + 4/5; a
9/5
sage:
edit retag flag offensive close merge delete

Comments

1

Are you sure that both installation are the same? pi must be a symbolic expression on any Operating System. Did you override $HOME/.sage/init.sage?

vdelecroix gravatar imagevdelecroix ( 2015-04-06 05:38:08 -0600 )edit

File $HOME/.sage/init.sage is missed at Mac OS X.

pochemuto gravatar imagepochemuto ( 2015-04-10 09:49:45 -0600 )edit

On Linux I have empty init.sage

spacediver gravatar imagespacediver ( 2015-04-10 11:51:54 -0600 )edit