|
|
|
@ -44,9 +44,9 @@ void EMSCRIPTEN_KEEPALIVE webdice(char* str){
@@ -44,9 +44,9 @@ void EMSCRIPTEN_KEEPALIVE webdice(char* str){
|
|
|
|
|
yyparse((void*) scanner, &root); |
|
|
|
|
if(root != NULL){ |
|
|
|
|
result = resolve(root); |
|
|
|
|
length = strlen(result.text) + 4 * ceill(log10l(result.max)) + 100; |
|
|
|
|
length = strlen(result.text) + 4 * ceill(10 + log10l(result.max)) + 100; |
|
|
|
|
out_block = (char*) malloc(length * sizeof(char)); |
|
|
|
|
sprintf(out_block,"<p>%s = <span title=\"min: %Lf, expected: %Lf, max: %Lf\">%Lf</span></p>", result.text, result.min, result.expected, result.max, result.actual); |
|
|
|
|
sprintf(out_block,"<p>%s = <span title=\"min: %Lg, expected: %Lg, max: %Lg\">%Lg</span></p>", result.text, result.min, result.expected, result.max, result.actual); |
|
|
|
|
|
|
|
|
|
output_print(out_block); |
|
|
|
|
|
|
|
|
|