29.8 * 22.15 == 660.07 // false

A Listing of Confirmed Scripting Bugs and Anomalies - Open to all but only moderators can post

Moderators: Tom, Kukurykus

User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

29.8 * 22.15 == 660.07 // false

Post by Kukurykus »

Extendscript:

Code: Select all

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

Chrome Browser Console (F12):

Code: Select all

29.8 * 22.15	//	660.0699999999999

Extendscript:

Code: Select all

29.8 * 22.15 == 660.0699999999999	//	true

minimal equality:

Code: Select all

29.8 * 22.15 == 660.06999999999988	//	true
maximal equality:

Code: Select all

29.8 * 22.15 == 660.069999999999993	//	true
so the range is: 993 - 88 = 905


Workarounds:

Code: Select all

(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

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: 29.8 * 22.15 == 660.07 // false

Post by txuku »

Bonjour

Can you explain the utility ??? :)
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: 29.8 * 22.15 == 660.07 // false

Post by Kukurykus »

Extendscirpt gives false for said comparison, although the result of calculation is the same I then used in comparison.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: 29.8 * 22.15 == 660.07 // false

Post by txuku »

I do not use Extendscript but notepad2 ! :)
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: 29.8 * 22.15 == 660.07 // false

Post by Kukurykus »

You use ES, it's adapted Javascript language for Adobe applications.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: 29.8 * 22.15 == 660.07 // false

Post by txuku »

I don't like it and prefer to launch my jsx directly - by adding alert () :)
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: 29.8 * 22.15 == 660.07 // false

Post by Kukurykus »

What don't you like?
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: 29.8 * 22.15 == 660.07 // false

Post by txuku »

maybe english tools ??? :)
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: 29.8 * 22.15 == 660.07 // false

Post by Kukurykus »

I don't know what you say about, but if still about Extendscript, it's not a tool but programming language designed also for Photoshop developers.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: 29.8 * 22.15 == 660.07 // false

Post by txuku »

Other programming tools that disgusted me ???