Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incorrect result
#2
I have no idea what's wrong with it, as it's mainly just a math formula, but here it is without all the GOTO and spaghetti code, if that helps anyone else sort out what it might possibly be doing wrong:

Code: (Select All)
P# = 3.141592653589793#
K# = 57.29577951308232#
S# = 279.559511
H# = 40
Cls: N# = 1: F# = 1
Do
T# = Sqr(2#) * Sqr(S# / (P# * F# / 180# - Sin(F# / K#))): L# = 2 * T# * Sin(F# / 2 / K#)
If (L# - H#) < 1D-10 Then Print Using "##.####"; T#: Exit Do
If H# > L# Then F# = F# - N#: N# = N# / 2
F# = F# + N#
Loop
Print " Ok."
Reply


Messages In This Thread
Incorrect result - by Chris - 08-14-2024, 08:53 AM
RE: Incorrect result - by SMcNeill - 08-14-2024, 09:56 AM
RE: Incorrect result - by luke - 08-14-2024, 12:26 PM
RE: Incorrect result - by Chris - 08-14-2024, 12:47 PM
RE: Incorrect result - by Pete - 08-14-2024, 03:03 PM
RE: Incorrect result - by SMcNeill - 08-14-2024, 03:34 PM
RE: Incorrect result - by Pete - 08-14-2024, 03:40 PM
RE: Incorrect result - by Chris - 08-15-2024, 06:29 PM
RE: Incorrect result - by TerryRitchie - 08-15-2024, 06:51 PM
RE: Incorrect result - by Kernelpanic - 08-15-2024, 07:39 PM
RE: Incorrect result - by Chris - 08-15-2024, 07:43 PM



Users browsing this thread: 1 Guest(s)