The manual does not specify how operations such as multiplication are being done. As a former lecturer in computer science, I would expect the engine to use a higher-precision representation while doing a multiplication or division, and then convert the final result back into the var format, but it seems as though this isn't happening. If one runs the following program, which multiplies numbers by 60, and enters 1.05, one finds that 60*1.05= 62.988. The Lite-C engine should be able to do multiplications with a relative error of plus or minor 1e-6. With a relative error of -1e-6, 60*1.05 would come out as 62.999937, which would then round to 63.000 when converted back into the var format. So, it seems as though the Lite-C designers have done something wrong here.

#include <acknex.h>
#include <default.c>

TEXT* prompt= {
pos_x = 100; pos_y = 60;
font = "Arial#24bi";
flags= VISIBLE;
strings= 1;
}

STRING* user_input_str= " "; // initialized to 12 blanks

TEXT* user_input_txt= {
pos_x = 200; pos_y = 100;
font = "Arial#24bi";
string(user_input_str);
flags= VISIBLE;
}

TEXT* result_txt= {
pos_x = 200; pos_y = 300;
font = "Arial#60b";
flags= VISIBLE;
strings= 1;
}

function main() {

video_mode = 7; // create a program window of 800x600 pixels
screen_color.blue = 50; // and make its background dark blue

// Display prompt:
str_cpy( (prompt.pstring)[0], "Enter a number x: ");

// Wait for user to type something (or nothing) followed by Enter:
inkey(user_input_str);

// Display result:
str_cpy( (result_txt.pstring)[0], "60 x= ");
str_cat_num( (result_txt.pstring)[0], "%0.3f", 60.0 * str_to_num(user_input_str));

}