08-14-2024, 08:53 AM
Hello.
Please correct the code. It gives an incorrect result.
P# = 3.141592653589793#
K# = 57.29577951308232#
S# = 279.559511
H# = 40
CLS: N# = 1: F# = 1: GOTO 22
21 F# = F# + N#
22 T# = SQR(2) * SQR(S# / (P# * F# / 180 - SIN(F# / K#))): L# = 2* T# * SIN(F# / 2 / K#)
IF (L# - H#) < 1E-10 THEN 23
IF H# > L# THEN 24
GOTO 21
23 PRINT USING "##.####"; T#: GOTO 25
24 F# = F# - N#: N# = N# / 2: GOTO 21
25 PRINT " Ok."
T# = 25.0000 -> result correct
T# = 24.7711 -> incorrect result
Chris
Please correct the code. It gives an incorrect result.
P# = 3.141592653589793#
K# = 57.29577951308232#
S# = 279.559511
H# = 40
CLS: N# = 1: F# = 1: GOTO 22
21 F# = F# + N#
22 T# = SQR(2) * SQR(S# / (P# * F# / 180 - SIN(F# / K#))): L# = 2* T# * SIN(F# / 2 / K#)
IF (L# - H#) < 1E-10 THEN 23
IF H# > L# THEN 24
GOTO 21
23 PRINT USING "##.####"; T#: GOTO 25
24 F# = F# - N#: N# = N# / 2: GOTO 21
25 PRINT " Ok."
T# = 25.0000 -> result correct
T# = 24.7711 -> incorrect result
Chris