Within the Prototyper, the result is 0.0 because you cannot execute the native code within the Prototyper. Within line 2 you set the result to 0.0. It is not changed, because the native code is not executed.
You can execute the code on your target. What target are you using? Does it work on the target?
Maybe you can explain what kind of GUI / project you are developing - this helps to understand your questions better.
Best regards,
Manfred.