none
Question about ^ in C# RRS feed

  • Question

  • Hi,

    I am trying to convert:

    = (SIN(B13/2))^2+COS(C3)*COS(C6)*(SIN(B14/2))^2

    to C# and got this:

    double the_a = (Math.Sin(dLat / 2)) ^ 2 + Math.Cos(latt_from_radians) * Math.Cos(latt_to_radians) * (Math.Sin(dLong / 2)) ^ 2;


    but I am getting error:

    Error CS0019 Operator '^' cannot be applied to operands of type 'double' and 'double'

    How can I fix this please?

    Thanks,

    Jassim

    Saturday, August 17, 2019 11:38 PM

Answers