Name:

print prints an expression

Usage:

print(expr1,...,exprn) : (any type,..., any type) -> void print(expr1,...,exprn) > filename : (any type,..., any type, string) -> void print(expr1,...,exprn) >> filename : (any type,...,any type, string) -> void

Parameters:

Description:

Example 1:

   > print(x + 2 + exp(sin(x)));
   x + 2 + exp(sin(x))
   > print("Hello","world");
   Hello world
   > print("Hello","you", 4 + 3, "other persons.");
   Hello you 7 other persons.

Example 2:

   > print("Hello");
   Hello
   > print([|"Hello"|]);
   [|"Hello"|]
   > s = "Hello";
   > print(s,[|s|]);
   Hello [|"Hello"|]
   > t = "Hello\tyou";
   > print(t,[|t|]);
   Hello you [|"Hello\tyou"|]

Example 3:

   > print(x + 2 + exp(sin(x))) > "foo.sol";
   > readfile("foo.sol");
   x + 2 + exp(sin(x))
   

Example 4:

   > print(x + 2 + exp(sin(x))) >> "foo.sol";

Example 5:

   > display = decimal;
   Display mode is decimal numbers.
   > a = evaluate(sin(pi * x), 0.25);
   > b = evaluate(sin(pi * x), [0.25; 0.25 + 1b-50]);
   > print(a);
   0.70710678118654752440084436210484903928483593768847
   > display = binary;
   Display mode is binary numbers.
   > print(a);
   1.01101010000010011110011001100111111100111011110011001001000010001011001011111011000100110110011011101010100101010111110100111110001110101101111011000001011101010001_2 * 2^(-1)
   > display = hexadecimal;
   Display mode is hexadecimal numbers.
   > print(a);
   0xb.504f333f9de6484597d89b3754abe9f1d6f60ba88p-4
   > display = dyadic;
   Display mode is dyadic numbers.
   > print(a);
   33070006991101558613323983488220944360067107133265b-165
   > display = powers;
   Display mode is dyadic numbers in integer-power-of-2 notation.
   > print(a);
   33070006991101558613323983488220944360067107133265 * 2^(-165)
   > display = decimal;
   Display mode is decimal numbers.
   > midpointmode = off;
   Midpoint mode has been deactivated.
   > print(b);
   [0.70710678118654752440084436210484903928483593768844;0.70710678118654949743721782517557347782646274417048]
   > midpointmode = on;
   Midpoint mode has been activated.
   > print(b);
   0.7071067811865~4/5~
   > display = dyadic;
   Display mode is dyadic numbers.
   > print(b);
   [2066875436943847413332748968013809022504194195829b-161;16535003495550825444196237019385936414432675156571b-164]
   > display = decimal;
   Display mode is decimal numbers.
   > autosimplify = off;
   Automatic pure tree simplification has been deactivated.
   > fullparentheses = off;
   Full parentheses mode has been deactivated.
   > print(x + x * ((x + 1) + 1));
   x + x * (x + 1 + 1)
   > fullparentheses = on;
   Full parentheses mode has been activated.
   > print(x + x * ((x + 1) + 1));
   x + (x * ((x + 1) + 1))
See also: write, printexpansion, printdouble, printsingle, printxml, readfile, autosimplify, display, midpointmode, fullparentheses, evaluate, rationalmode
Go back to the list of commands