addaptic

Reference Trigonometry

lz_cosine

The cosine of an angle.

long lz_cosine( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );

Correctly rounded, in the thread's angle unit. Outside radians an angle whose cosine is rational is answered exactly: cos 60° is 0.5 and cos 90° is nought.

Examples

CallAnswer
lz_cosine( 1 )0.540302305868139717400936607442976604
lz_cosine( 60 ) degrees0.5
lz_cosine( 90 ) degrees0

Each answer is what Addaptic printed for the call, in radians, at 36 places unless a setting is shown.

Returns

kNoError (0) when the answer is written. Otherwise an error code, with the answer flagged infinite or not-a-number; see Errors and flags.

See also

  • lz_sine The sine of an angle.
  • lz_sine_cosine The sine and the cosine of one angle together, for about half the cost of the two.
  • lz_arccosine The angle whose cosine is the number.
  • lzc_cosine The cosine of a complex angle.