Modify

Opened 17 years ago

Closed 17 years ago

#1103 closed Bug (No Bug)

Scientific convertion to integer adding +1. (x>=2^49)

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.1.1 Severity: None
Keywords: Scientific notation Cc:

Description

; Scientific conversion to integer adding +1. (x>=2^49)
; from value 2^49 and up. 
Local $i,$j,$k,$v
$v = 562949953421312 ; int(2^49)
For $i = $v-2 To $v+2
	$j = $i * 1e0
	$k = int($j)
	If ($j=$k) Then
		ConsoleWrite('> ')
	Else
		ConsoleWrite('- ')
	EndIf
	ConsoleWrite($i&', '&$j&', '&($j=$k)&', '&$k&'.'&@CRLF)
Next
;~ > 562949953421310, 562949953421310, True, 562949953421310.
;~ > 562949953421311, 562949953421311, True, 562949953421311.
;~ - 562949953421312, 562949953421312, False, 562949953421313.
;~ - 562949953421313, 562949953421313, False, 562949953421314.
;~ - 562949953421314, 562949953421314, False, 562949953421315.

Attachments (0)

Change History (1)

comment:1 by J-Paul Mesnage, 17 years ago

Resolution: No Bug
Status: newclosed

No bug, you cannot assume that the precision of a Float number to integer can take in account number that have around 15 digits precision.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.