I'm in the process of converting some Python code to C and have come across a structure I'm not sure on how to translate:(adsbygoogle = window.adsbygoogle || []).push({});

(This is a hybrid of the two languages)

Does anyone know how to get this fully to C? It is trying to return acos(ang)*RAD_2_DEG and if it catches ValueError, it then checks if ang is less than -1.0 and returns a value of 180 or 0 based on that. Any help would be appreciated.Code (Text):try:

return(acos(ang)*RAD_2_DEG);

except ValueError:

if (ang < -1.0)

return(180.0);

else

return(0.0);

Thanks in advance.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Converting Py to C

Loading...

Similar Threads for Converting |
---|

Converting a DFA to efficient code? |

Python Help: Convert Matlab to Python code |

**Physics Forums | Science Articles, Homework Help, Discussion**