Highlighted

29.8 * 22.15 == 660.07 // false

Adobe Community Professional ,
Apr 11, 2020

Copy link to clipboard

Copied

29.8 * 22.15 == 660.07 // false

 

Extendscript:

29.8 * 22.15 // 660.07
29.8 * 22.15 == 660.07 // false

 

Chrome Browser Console (F12):

29.8 * 22.15 // 660.0699999999999


Extendscript:

29.8 * 22.15 == 660.0699999999999 // true

 

minimal equality:

29.8 * 22.15 == 660.06999999999988 // true

maximal equality:

29.8 * 22.15 == 660.069999999999993 // true

so the range is: 993 - 88 = 905

 

Workarounds:

(29.8 * 22.15).toString() == 660.07; // true
(29.8 * 22.15).toFixed(2) == 660.07; // true
(29.8 * 22.15).toPrecision(5) == 660.07; // true

Topics

Actions and scripting, Bug

Views

461

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

29.8 * 22.15 == 660.07 // false

Adobe Community Professional ,
Apr 11, 2020

Copy link to clipboard

Copied

29.8 * 22.15 == 660.07 // false

 

Extendscript:

29.8 * 22.15 // 660.07
29.8 * 22.15 == 660.07 // false

 

Chrome Browser Console (F12):

29.8 * 22.15 // 660.0699999999999


Extendscript:

29.8 * 22.15 == 660.0699999999999 // true

 

minimal equality:

29.8 * 22.15 == 660.06999999999988 // true

maximal equality:

29.8 * 22.15 == 660.069999999999993 // true

so the range is: 993 - 88 = 905

 

Workarounds:

(29.8 * 22.15).toString() == 660.07; // true
(29.8 * 22.15).toFixed(2) == 660.07; // true
(29.8 * 22.15).toPrecision(5) == 660.07; // true

Topics

Actions and scripting, Bug

Views

462

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Apr 19, 2020

Copy link to clipboard

Copied

var x = 29.8 * 22.15;
var y = 660.07;

alert(Number(x).toSource() == Number(y).toSource())

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Apr 19, 2020

Copy link to clipboard

Copied

You mean that's another workaround?

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Employee ,
Aug 25, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...