Вверх ↑
Ответов: 91
Рейтинг: 0
#1: 2020-08-03 11:13:05 ЛС | профиль | цитата
Здравствуйте!
Не пойму, почему в простой операции вычитания появляется погрешность?

в точках отладки видно 40159.96-40158.0=1.95999999999913


Add(MainForm,15551238,105,189)
{
Width=529
Height=449
Caption="Домашний из Exel в AdsMan"
link(onActivate,11230900:doEvent1,[(153,195)(153,342)])
}
Add(Edit,6514230,231,287)
{
Left=95
Top=35
Width=135
Text="11:09:19:20"
link(onChange,9832680:doCompare,[])
link(Str,14626914:Value,[])
}
Add(MultiStrPart,5645447,378,294)
{
Char=":"
Count=4
link(onSplit,16227320:doCalc,[(422,300)(422,337)(364,337)(364,356)])
}
Add(MathParse,16227320,378,350)
{
DataCount=4
MathStr="%1*3600 + %2*60 + %3 + %4*0.04"
link(X1,5645447:Part1,[])
link(X2,5645447:Part2,[])
link(X3,5645447:Part3,[])
link(X4,5645447:Part4,[])
}
Add(Memory,14626914,231,196)
{
Default=String(11:09:18:00)
}
Add(DateConvertor,9690866,868,322)
{
Mode=16
Format="HH:mm:ss"
Point(Result)
}
Add(Hub,4953039,609,350)
{
OutCount=8
link(onEvent1,13190396:doStrCat,[(745,356)(745,328)])
link(onEvent4,6336814:doSplit,[])
link(onEvent5,13178911:doSplit,[(636,384)(636,447)])
}
Add(Edit,5655643,1092,371)
{
Left=90
Top=125
Width=140
Text=""
}
Add(Edit,1343489,1092,441)
{
Left=90
Top=150
Width=140
Text=""
}
Add(MathParse,15435686,882,371)
{
DataCount=1
MathStr="%1*100/4"
link(onResult,12515832:doWork2,[])
}
Add(StrPart,6336814,679,371)
{
Char="."
Point(onNotFound)
link(onSplit,8055310:doString,[])
link(onNotFound,10871200:doClear,[(723,391)(723,398)])
}
Add(FormatStr,8055310,826,371)
{
DataCount=1
Mask="0.%1"
link(onFString,15435686:doCalc,[])
}
Add(StrPart,13178911,742,441)
{
Char="."
Point(onNotFound)
link(onSplit,351203:doWork2,[])
link(onNotFound,8563622:doClear,[(786,461)(786,468)])
}
Add(FormatStr,11352897,861,441)
{
Mask="%2.%1"
Point(FString)
link(onFString,2892672:doLength,[])
link(Str2,13208133:Var2,[])
}
Add(FormatStr,1515380,1008,371)
{
Mask="%2:%1"
link(onFString,5655643:doText,[])
link(Str2,13208133:Var3,[(1021,362)])
}
Add(GetDataEx,13208133,868,357)
{
link(Data,9690866:Result,[])
}
Add(StrMask,9832680,301,287)
{
Mask="##:##:##:##"
link(onTrue,5645447:doSplit,[])
}
Add(Memory,8563622,798,455)
{
Default=String(00)
link(onData,351203:doWork3,[(844,461)])
}
Add(HubEx,351203,840,441)
{
link(onEvent,11352897:doString,[])
}
Add(Memory,10871200,735,385)
{
Default=String(00)
link(onData,12515832:doWork3,[(811,391)(811,428)(977,428)])
}
Add(HubEx,12515832,973,371)
{
link(onEvent,1515380:doString,[])
}
Add(Length,2892672,910,441)
{
link(onLength,4567632:doCompare,[])
}
Add(If_else,4567632,959,441)
{
Op2=Integer(11)
link(onTrue,5478475:doString,[])
link(onFalse,4900880:doString,[(1010,454)(1010,496)])
}
Add(FormatStr,4900880,1022,490)
{
Mask="%1%2"
link(onFString,10977111:doWork3,[(1061,496)])
link(Str1,16448502:Var3,[(1028,482)])
link(Str2,14942401:Value,[(1035,478)(1067,478)(1067,534)(1098,534)])
}
Add(HubEx,10977111,1057,441)
{
link(onEvent,1343489:doText,[])
}
Add(FormatStr,5478475,1022,441)
{
Mask="%1"
link(onFString,10977111:doWork2,[])
link(Str1,16448502:Var1,[(1028,429)(1014,429)])
}
Add(GetDataEx,16448502,1008,477)
{
Angle=3
link(Data,11352897:FString,[(867,482)])
}
Add(Memory,14942401,1092,490)
{
Default=String(0)
}
Add(StrCat,13190396,763,322)
{
link(onStrCat,9690866:doConvert,[])
}
Add(Edit,15697781,231,490)
{
Left=95
Top=60
Width=135
Text="11:09:19:20"
link(onChange,3595563:doCompare,[])
link(Str,11553315:Value,[])
}
Add(MultiStrPart,640633,378,497)
{
Char=":"
Count=4
link(onSplit,9457343:doCalc,[(422,503)(422,540)(364,540)(364,559)])
}
Add(MathParse,9457343,378,553)
{
DataCount=4
MathStr="%1*3600 + %2*60 + %3 + %4*0.04"
link(X1,640633:Part1,[])
link(X2,640633:Part2,[])
link(X3,640633:Part3,[])
link(X4,640633:Part4,[])
}
Add(Memory,11553315,231,399)
{
Default=String(11:09:19:24)
}
Add(StrMask,3595563,301,490)
{
Mask="##:##:##:##"
link(onTrue,640633:doSplit,[])
}
Add(Hub,11230900,168,336)
{
OutCount=8
link(onEvent1,6514230:doText,[(206,342)(206,293)])
link(onEvent2,15697781:doText,[(206,349)(206,496)])
link(onEvent3,15704663:doOperation,[(315,356)(315,440)])
}
Add(Math,15704663,448,434)
{
OpType=1
AngleMode=1
link(onResult,12808265:doText,[(502,440)(502,356)])
link(Op1,1255876:Var,[(454,422)])
link(Op2,5239000:Var,[(461,408)])
}
Add(Edit,12808265,525,350)
{
Left=90
Top=90
Width=175
Text=""
link(onChange,4953039:doEvent1,[])
link(Str,353556:Var,[(531,338)])
}
Add(Debug,5239000,448,399)
{
link(Data,16227320:Result,[(384,408)])
}
Add(Debug,1255876,427,413)
{
link(Data,9457343:Result,[(419,422)(419,597)(384,597)])
}
Add(Debug,353556,504,336)
{
link(Data,15704663:Result,[(493,338)(493,478)(454,478)])
}


карма: 0

0