Modify

Opened 15 years ago

Closed 15 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 Changed 15 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.