In all instances, either both Fahrenheit and Celsius are negative, making the sum negative, or the Fahrenheit value is larger than the Celsius value, so I assume that the difference is meant to be N-M, that is, the Fahrenheit reading minus the Celsius reading. The results make that assumption:
M N M+N N-M
40 104 144 64
680 1256 1936 576
58280 104936 163216 46656
633640 1140584 1774224 506944
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For c = -273 To 1000000# Step 0.5
DoEvents
f = c * 9 / 5 + 32
sq1 = c + f: sq2 = f - c
If sq1 > 0 Then
If f > c Then
sr = Int(Sqr(sq1) + 0.5)
If sr * sr = sq1 Then
sr = Int(Sqr(sq2) + 0.5)
If sr * sr = sq2 Then
Text1.Text = Text1.Text & c & Str(f) & " " & Str(c + f) & Str(f - c) & crlf
End If
End If
Else
End If
End If
Next
Text1.Text = Text1.Text & " done"
End Sub
|
Posted by Charlie
on 2016-06-29 16:27:56 |