This script for AHK v2:
Shows this value in the msgbox:
EDIT: Tried this in AHK v2-a112 and a108 ... same thing.
I tried this in AHK v1.1.33:
msgbox % 1.0009
And the expected 1.0009 is displayed.
Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
5 posts • Page 1 of 1
https://lexikos.github.io/v2/docs/Concepts.htm#numbers wrote:Floating-point numbers are formatted with full precision (but discarding redundant trailing zeroes), which may in some cases reveal their inaccuracy.
The equivalent script for v2 ismsgbox % 1.0009
because in v1 a floating-point literal is always just a string, but
Code: Select all
All literal numbers are converted to pure binary numbers at load time and their string representation is discarded. For example, MsgBox 0x1 is equivalent to MsgBox 1, while MsgBox 1.0000 is equivalent to MsgBox 1.0 (because the float formatting has changed). Storing a number in a variable or returning it from a UDF retains its pure numeric status.
Who is online
Users browsing this forum: Kapitano and 10 guests