% Copy the following commands line by line into matlab and see what happens
% make sure matlab's 'current directory' is the one that contains
% chopk.m and roundk.m
%
% To execute this .m file, put it in the same directory as 
% chopk.m and roundk.m, the type the name of this file, 
% (excluding the final ".m" part).
% 

clear;

format long

x = 0.123456

% perform 3 digits rounding on x and echo on the screen
xr3 = roundk(x,3)

% perform 4 digits chopping on x and echo on the screen
xc4 = chopk(x,4)

