• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Code compiles, having minor error with returning values

RedArmy

Platinum Member
How exactly do I return the values correctly do the output function? I've tried a few different ways but I either get a QNAN as an output, or random numbers. Maybe it's my math, or maybe it's the way I've tried returning it, either way, I'm not sure. Any help is appreciated like always!

http://pastebin.org/27041
 
When you group a bunch of expressions together the way you have it can be hard to see what's going on, and I don't have the time tonight to parse it all out. Maybe someone else here will. But I would use some locals in compute() and calculate the intermediate values into them for use in the final calculations. It will simplify your expressions and allow you to see what is being produced at each stage.
 
it looks like you construct the object with 0 values, call compute (with all the values being 0), input new values but don't call compute and output the values

edit: compute returns a double? i don't see it returning anything. gah this code is hard to read.
 
Back
Top