User Tools

A PCRE internal error occured. This might be caused by a faulty plugin


This shows you the differences between two versions of the page.

Link to this comparison view

cl:constant_variables:pi [2019/12/05 02:00]
cl:constant_variables:pi [2020/07/04 16:00] (current)
Line 1: Line 1:
 +====== Constant Variable PI ======
 +an //​[[CL:​Glossary:​implementation-dependent]]//​ //​[[CL:​Glossary:​long float]]//.
 +The best //​[[CL:​Glossary:​long float]]// approximation to the mathematical constant ''​π''​.
 +In each of the following computations,​ the precision depends on the //​[[CL:​Glossary:​implementation]]//​. Also, if //​[[CL:​Glossary:​long float]]// is treated by the //​[[CL:​Glossary:​implementation]]//​ as equivalent to some other //​[[CL:​Glossary:​float]]//​ format (e.g., //​[[CL:​Glossary:​double float]]//) the exponent marker might be the marker for that equivalent (e.g., ''​D''​ instead of ''​L''​). ​
 +<​blockquote> ​
 +pi <​r>​3.141592653589793L0 </r>
 +([[CL:​Functions:​cos]] pi) <​r>​-1.0L0</​r>​
 +([[CL:​Macros:​defun]] sin-of-degrees (degrees) ​
 +  ([[CL:​Special Operators:​let]] ((x ([[CL:​Special Operators:​if]] ([[CL:​Functions:​floatp]] degrees) ​
 +               ​degrees ​
 +               ​([[CL:​Functions:​float]] degrees pi)))) ​
 +    ([[CL:​Functions:​sin]] ([[CL:​Functions:​math-multiply*]] x ([[CL:​Functions:​math-divide|/​]] ([[CL:​Functions:​float]] pi x) 180)))))
 +====See Also====
 +An approximation to ''​π''​ in some other precision can be obtained by writing ''​([[CL:​Functions:​float]] pi x)'',​ where ''​x''​ is a //​[[CL:​Glossary:​float]]//​ of the desired precision, or by writing ''​(coerce pi //​type//​)'',​ where //type// is the desired type, such as **[[CL:​Types:​short-float]]**.