Firmware 2021 - Test PRINT and PRINT2D cmds
Hello hp¹s
In firmware 2021, we have a new PRINT2D command in math book print format. =]
A: PRINT2D does not work in CAS mode =(
Quote:PRINT2D Syntax:
PRINT2D(obj, [font], [color], flags)
PRINTED )
Prints either the result of expr or string to the terminal. The display will be done using textbook display
B: The tab symbol must be invisible in terminal view and visible in edit as ⇥
PHP Code:
PRINT( "Hello\n\tworld \\ \" " ); // Hello world \ " PRINT2D( "Hello\n\tworld \\ \" " ); print( "Hello\n\tworld \\ \" " );
Basic escape characters work great in the code editor, but not yet in the history view =(
Test PRINT & PRINT2D cmds
HOME MODE:
PHP Code:
EXPORT print_cmds_home() BEGIN PRINT(); // Clear terminal output PRINT( (50 - 5*6) / 4 ); // 5, evaluates, ok PRINT2D( (50 - 5*6) / 4 ); // 5, evaluates, ok PRINT( "\n" ); // new line, ok PRINT( quote(5 ^ 2) ); // 5^2, 1D without evaluating, ok PRINT( '5 ^ 2' ); // 5^2, 1D without evaluating, ok PRINT2D( quote(5 ^ 2) ); // 5² , 2D without evaluating, ok PRINT2D( '5 ^ 2' ); // 5² , 2D without evaluating, ok PRINT( 5 ^ 2 ); // 25, ok PRINT2D( 5 ^ 2 ); // 25, ok PRINT( "\n" );
PRINT( '(50 - (5*6)) / 4' ); // 1D without evaluating, ok PRINT2D( '(50 - (5*6)) / 4' ); // 2D without evaluating, ok PRINT( "\n" ); PRINT( "Hello\n\tworld \\ \" " ); // Hello world \ " PRINT2D( "Hello\nworld" ); PRINT( "\n" );
PRINT2D( '17 / 3' ); // 17/3, rational division without evaluating, ok PRINT2D( 17 / 3 ); // 5.6666... , approximate value calculation, ok PRINT( "\n" ); PRINT2D( 'floor(17 / 3)' ); // print as function floor(17 / 3), but ⌊ 17/3 ⌋ is real 2D mathbook print, 8970 (⌊) & 8971(⌋) unicode char PRINT2D( floor(17 / 3) ); // 5, ok, floor division discards the fractional part PRINT( "\n" ); PRINT2D( 'ceiling(17 / 3)' ); // print as ceiling(17 / 3), but ⌈ 17/3 ⌉ is real 2D mathbook print, 8968(⌈)/8969(⌉) unicode char PRINT2D( ceiling(17 / 3) ); // 6 PRINT( "\n" ); PRINT2D( '17 MOD 3' ); // 17 MOD 3 PRINT2D( 17 MOD 3 ); // 2, ok, the MOD operator returns the remainder of the division PRINT( "\n" ); PRINT2D( 'abs(3+4*i)' ); // | 3 + 4i |, ok PRINT2D( abs(3+4*i) ); // 5, ok PRINT( "\n" );
RETURN( "Done" ); END;
Test print (lowercase) cmd
CAS MODE:
PHP Code:
#cas print_cmds_cas():= BEGIN print(); // Clear terminal output print( (50 - 5*6) / 4 ); // 5, evaluates, ok print( (50 - 5*6) / 4 ); // 5, evaluates, ok print( "\n" ); // still not print new line =( print( string(quote(5 ^ 2) )); // "5^2", 1D without evaluating print( string('5 ^ 2') ); // "5^2", 1D without evaluating print( quote(5 ^ 2) ); // 5² , 2D without evaluating, ok print( '5 ^ 2' ); // 5² , 2D without evaluating, ok print( 5 ^ 2 ); // 25, ok print( 5 ^ 2 ); // 25, ok print( "\n" );
print( string('(50 - (5*6)) / 4' )); // 1D without evaluating print( '(50 - (5*6)) / 4' ); // 2D without evaluating, ok print( "\n" ); print( "Hello\n\tworld \\ \" " ); // Hello world \ " print( "Hello\nworld" ); print( "\n" );
print( '17 / 3' ); // 17/3, rational division without evaluating, ok print( 17 / 3. ); // 5.6666... , approximate value calculation, ok print( "\n" ); print( 'floor(17 / 3)' ); // print as function floor(17 / 3), but ⌊ 17/3 ⌋ is real 2D mathbook print, 8970 (⌊) & 8971(⌋) unicode char print( floor(17 / 3) ); // 5, ok, floor division discards the fractional part print( "\n" ); print( 'ceiling(17 / 3)' ); // print as ceiling(17 / 3), but ⌈ 17/3 ⌉ is real 2D mathbook print, 8968(⌈)/8969(⌉) unicode char print( ceiling(17 / 3) ); // 6 print( "\n" ); print( '17 MOD 3' ); // 17 MOD 3 print( 17 MOD 3 ); // 2, ok, the MOD operator returns the remainder of the division print( "\n" ); print( 'abs(3+4*i)' ); // | 3 + 4i |, ok print( abs(3+4*i) ); // 5, ok print( "\n" );
RETURN( "Done" ); END; #end
output comparison between HOME and CAS
|