https://www.reddit.com/r/software/comme ... alculator/
They want to get this math equation calculated so that it shows the result of 0.99999...
Code: Select all
(9460730472580800 * 4.3) / (((9460730472580800 * 4.3) ^ 2 + (.0617/2) ^ 2) ^ .5)
Code: Select all
(9460730472580800 * 4.3) / (((9460730472580800 * 4.3) ^ 2 + (.0617/2) ^ 2) ^ .5)
Code: Select all
result.d = (9460730472580800 * 4.3) / Pow(Pow(9460730472580800 * 4.3, 2) + Pow(0.0617/2, 2), 0.5)
Debug result
Code: Select all
(9460730472580800 * 4.3) / (((9460730472580800 * 4.3) ^ 2 + (.0617/2) ^ 2) ^ .5)
Code: Select all
#HighPrecisionEquation = "(9460730472580800 * 4.3) / (((9460730472580800 * 4.3) ^ 2 + (.0617/2) ^ 2) ^ .5)"
#MoreDigitsLevel = "2"
URL.s = "https://api.wolframalpha.com/v2/query"
AppId.s = "?appid=XXXXXX-XXXXXXXXXX"
Input.s = "&input=" + URLEncoder(#HighPrecisionEquation)
PodState.s = "&podstate=" + #MoreDigitsLevel + "@Result__More+digits"
Output.s = "&output=JSON"
InitNetwork()
Debug PeekS(ReceiveHTTPMemory(URL + AppId + Input + PodState + Output), -1, #PB_UTF8)
Code: Select all
#Precision=20000
Procedure.s Zahl(Adresse,len=#Precision)
Protected s.s=Space(len)
gmp_snprintf(s,len,"%Z."+Str(len)+"Ff",Adresse)
ProcedureReturn s
EndProcedure
Procedure Dude()
mpf_set_default_prec(#Precision)
x.mpf
y.mpf
z.mpf
a.mpf
b.mpf
c.mpf
s.s
mpf_init2(@x,#Precision)
mpf_init2(@y,#Precision)
mpf_init2(@z,#Precision)
mpf_init2(@a,#Precision)
mpf_init2(@b,#Precision)
mpf_init2(@c,#Precision)
mpf_set_str(@a,"9460730472580800",10)
mpf_set_str(@b,"4.3",10)
mpf_set_str(@c,"0.617",10)
mpf_mul(@x,@a,@b)
mpf_pow_ui(@y,@x,2)
mpf_div_ui(@z,@c,2)
mpf_pow_ui(@z,@z,2)
mpf_add(@y,@y,@z)
mpf_sqrt(@y,@y)
mpf_div(@x,@x,@y)
Debug zahl(@x,#Precision/10)
mpf_clear(@x)
mpf_clear(@y)
mpf_clear(@z)
mpf_clear(@a)
mpf_clear(@b)
mpf_clear(@c)
EndProcedure