Jump to content

Recommended Posts

Posted

$QUOTE_END = 161.10
$QUOTE_STA = 161.05

    $QUOTE_END -= 0.05
    MsgBox(0,"",$QUOTE_END & "  " & $QUOTE_STA,2)
    MsgBox(0,"",$QUOTE_END >= $QUOTE_STA,2)

isn't 161.05>=161.05?

why it gives false instead of ture?

thanks

Posted

Even just = doesn't work. I guess it's some weirdness with how AutoIt habndles floating numbers, Rounding them works fine :

$QUOTE_END = 161.10
$QUOTE_STA = 161.05

    $QUOTE_END -= 0.05
    MsgBox(0,"",Round($QUOTE_END,2) & "  " & $QUOTE_STA)
    MsgBox(0,"",Round($QUOTE_END,2) >= $QUOTE_STA)
Posted (edited)

thanks

must be a bug in Autoit

It's not AutoIt, it's floating point precision. There many threads on these forums discussing this issue. Edited by picaxe
Posted

thanks

must be a bug in Autoit

This is a standard behavior of floating point math on computers. It is correct to about 14 decimal places. AutoIt gets its math from the C++ libraries used to write and compile the interpreter.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...