Does the Power Vision compiler use Constant folding for operations that contain "const" variables?
Essentially I have a some geometry calculations which, require a large amount of trig operations as well of a regular maths operations. Most of the parameters are constants and many of the operations could be replaced with magic numbers if I wanted to do the calculations with pen and paper before I write the code.
However this would be very bad for the readability of my code. If I leave the operations in the code and declare all of the constants as 'const' will will the compiler simplify these operations to make the code as efficient as if I had done the calculation with pen and paper.
Constant Folding
- CustomFP
- Posts: 41
- Joined: Thu Mar 22, 2012 4:12 pm
- stalley
- Enovation Controls Development
- Posts: 618
- Joined: Tue Mar 18, 2014 12:57 pm
Re: Constant Folding
Hello CustomPF,
There doesn't seem to be a direct answer in the AngelScript documentation. The assumption is that the code is executed once and stored at startup.
There doesn't seem to be a direct answer in the AngelScript documentation. The assumption is that the code is executed once and stored at startup.
Sara Talley
Software Engineer
Enovation Controls
Software Engineer
Enovation Controls