Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function "_ARCSEC()" is wrong?
#9
Something else comes out of it too. Wait for @Spinoza.

Code: (Select All)

Option _Explicit

Declare Function ARCSECF(x As Integer) As Double

Dim As Integer arcsecw, x

x = -2.5

Const PI = 1.141593

'Print _Arcsec(-2.5
Print
Print _Acos(1 / -2.5)
Print
Print ARCSECF(-2.5)

Print
arcsecw = _Acos(1 / x)
Print arcsecw

End

Function ARCSECF (x As Integer) 'Inverse Secant

  Dim As Double Arcsec

  If x <= 1 Or x >= 1 Then
    Arcsec = Atn(Sqr(x * x - 1)) + Sgn(Sgn(x) - 1) * PI
  Else Beep
  End If
  ARCSECF = Arcsec
End Function
Reply


Messages In This Thread
function "_ARCSEC()" is wrong? - by BSpinoza - 10-28-2023, 05:44 AM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 01:40 PM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-28-2023, 01:53 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 02:42 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 02:56 PM
RE: function "_ARCSEC()" is wrong? - by bplus - 10-28-2023, 04:42 PM
RE: function "_ARCSEC()" is wrong? - by Kernelpanic - 10-28-2023, 05:00 PM
RE: function "_ARCSEC()" is wrong? - by BSpinoza - 10-29-2023, 06:04 AM
RE: function "_ARCSEC()" is wrong? - by BSpinoza - 10-30-2023, 09:22 AM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-30-2023, 10:24 AM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-30-2023, 02:42 PM
RE: function "_ARCSEC()" is wrong? - by SMcNeill - 10-31-2023, 04:23 PM



Users browsing this thread: 5 Guest(s)