Incorrect comparison of some float numbers

Get help with using AutoHotkey and its commands and hotkeys
teadrinker
Posts: 2766
Joined: 29 Mar 2015, 09:41
Contact:

Incorrect comparison of some float numbers

12 Jan 2016, 08:26

I have these examples working improperly:

Code: Select all

MsgBox, % (a := 1.1 - 0.6) . "`n" . (a = 0.500000)
MsgBox, % (a := 1.2 - 0.8) . "`n" . (a = 0.400000)
However, this one works correctly:

Code: Select all

MsgBox, % (a := 1.2 - 0.7) . "`n" . (a = 0.500000)
Windows 7 x64 Home Premium, AHK Unicode 64-bit 1.1.22.9
teadrinker
Posts: 2766
Joined: 29 Mar 2015, 09:41
Contact:

Re: Incorrect comparison of some float numbers

12 Jan 2016, 08:53

Thanks, I have been overtaken by somebody. :)

Return to “Ask For Help”

Who is online

Users browsing this forum: effel, ewerybody, FanaticGuru, foltugokki, JnLlnd, kczx3, kunkel321, Magija, malcev, mikeyww, SilentlyFiguring, Smile_ and 59 guests