Custom Query (3931 matches)
Results (79 - 81 of 3931)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #3817 | Fixed | Double to Int64 type conversion - wrong results | ||
| Description |
Following script: $fN = 562949953421312.0
$iN = Int($fN, 2)
$iN2 = Number($iN, 2)
ConsoleWrite("$fN :" & $fN & " (" & VarGetType($fN) & ")" & @CRLF & _
"$iN :" & $iN & " (" & VarGetType($iN) & ")" & @CRLF & _
"$iN2:" & $iN2 & " (" & VarGetType($iN2) & ")" & @CRLF)
produces:
This applies to all integer numbers >= 249 stored as double. The numbers themselves can be mapped completely and without rounding errors in IEEE 754 double precision.
The naive approach to implementing an #include <iostream>
using namespace std;
int main()
{
double f = 562949953421312.0;
long long iInt1 = (long long)f;
long long iInt2 = static_cast<long long>(f);
cout<<iInt1<<"\n"<<iInt2;
}
In old public source codes of AutoIt also the C-cast was used for the |
|||
| #3850 | Fixed | _WinAPI_GetDriveNumber never returns -1 as partition number | ||
| Description |
The documentation for _WinAPI_GetDriveNumber says:
This is consistent with the description of the STORAGE_DEVICE_NUMBER structure.
However, the problem here is that the PartitionNumber part is of data type (DWORD)4294967295 == -1 // true
In AutoIt, however, #include <WinAPIFiles.au3> Local $aData = _WinAPI_GetDriveNumber('d:') ; a non partionable drive like a cd-drive ConsoleWrite('Partition number: ' & $aData[2] & @CRLF) Therefore, as a pragmatic solution, I suggest to change the structure definition as follows, deviating from the Win API documentation: Local $tSDN = DllStructCreate('dword;dword;LONG') |
|||
| #3869 | Fixed | Subtraction operator before power operation is parsed incorrectly | ||
| Description |
For the operation of the basic form The following test script: Global $sString = "" $x = 2 $y = 4 $sString = StringFormat("% 15s = %d\n", "11 - 2 ^ 4", 11 - 2 ^ 4) & _ StringFormat("% 15s = %d\n", "11 - 2.0 ^ 4", 11 - 2.0 ^ 4) & _ StringFormat("% 15s = %d\n", "11 - 2e0 ^ 4", 11 - 2e0 ^ 4) & _ StringFormat("% 15s = %d\n", "11 - '2' ^ 4", 11 - '2' ^ 4) & _ StringFormat("% 15s = %d\n", "11 - $x ^ 4", 11 - $x ^ 4) & _ StringFormat("% 15s = %d\n", "11 - (2 ^ 4)", 11 - (2 ^ 4)) & _ StringFormat("% 15s = %d\n", "11 - - 2 ^ 4", 11 - - 2 ^ 4) & _ StringFormat("% 15s = %d\n\n", "11 - 2 ^ $y", 11 - 2 ^ $y) $y = 3 $sString &= StringFormat("% 15s = %d\n", "11 - 2 ^ 3", 11 - 2 ^ 3) & _ StringFormat("% 15s = %d\n", "11 - 2.0 ^ 3", 11 - 2.0 ^ 3) & _ StringFormat("% 15s = %d\n", "11 - 2e0 ^ 3", 11 - 2e0 ^ 3) & _ StringFormat("% 15s = %d\n", "11 - '2' ^ 3", 11 - '2' ^ 3) & _ StringFormat("% 15s = %d\n", "11 - $x ^ 3", 11 - $x ^ 3) & _ StringFormat("% 15s = %d\n", "11 - (2 ^ 3)", (11 - 2 ^ 3)) & _ StringFormat("% 15s = %d\n", "11 - - 2 ^ 3", 11 - 2 ^ 3) & _ StringFormat("% 15s = %d\n\n", "11 - 2 ^ $y", 11 - 2 ^ $y) ConsoleWrite($sString) produces under 3.3.16.0: 11 - 2 ^ 4 = 27
11 - 2.0 ^ 4 = 27
11 - 2e0 ^ 4 = 27
11 - '2' ^ 4 = -5
11 - $x ^ 4 = -5
11 - (2 ^ 4) = -5
11 - - 2 ^ 4 = -5
11 - 2 ^ $y = 27
11 - 2 ^ 3 = 3
11 - 2.0 ^ 3 = 3
11 - 2e0 ^ 3 = 3
11 - '2' ^ 3 = 3
11 - $x ^ 3 = 3
11 - (2 ^ 3) = 3
11 - - 2 ^ 3 = 3
11 - 2 ^ $y = 3
and under 3.3.14.5: 11 - 2 ^ 4 = 27 11 - 2.0 ^ 4 = -5 11 - 2e0 ^ 4 = -5 11 - '2' ^ 4 = -5 11 - $x ^ 4 = -5 11 - (2 ^ 4) = -5 11 - - 2 ^ 4 = -5 11 - 2 ^ $y = 27 11 - 2 ^ 3 = 3 11 - 2.0 ^ 3 = 3 11 - 2e0 ^ 3 = 3 11 - '2' ^ 3 = 3 11 - $x ^ 3 = 3 11 - (2 ^ 3) = 3 11 - - 2 ^ 3 = 3 11 - 2 ^ $y = 3 Two possible explanations for this behaviour:
|
|||
