Skip to content

Commit 987c648

Browse files
Fix sqrt() function returning NaN when...
...it's using negative numbers.
1 parent 84d25bc commit 987c648

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projectm-eval/TreeFunctions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ prjm_eval_function_decl(sqrt)
952952

953953
invoke_arg(0, &math_arg_ptr);
954954

955-
assign_ret_val(sqrt(*math_arg_ptr));
955+
assign_ret_val(sqrt(fabs(*math_arg_ptr)));
956956
}
957957

958958
prjm_eval_function_decl(pow)

0 commit comments

Comments
 (0)