Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fabric.util): iterator step could`t be 0.01 #7233

Merged
merged 3 commits into from
Aug 27, 2021

Conversation

meetwhere-dev
Copy link
Contributor

ex: 0.1 + 0.2 = 0.0000...00034

it will loss last one step when cal Path`s totalLength.

@melchiar
Copy link
Member

Sigh... Floating point errors. 😞

Nice find.

@asturur
Copy link
Member

asturur commented Aug 2, 2021

@meetwhere-dev this is ok, but can you remove the built dist file?
git checkout master dist is what i usually do.

@meetwhere-dev
Copy link
Contributor Author

@meetwhere-dev this is ok, but can you remove the built dist file?
git checkout master dist is what i usually do.

oh Sorry about that.
I will take it

@asturur
Copy link
Member

asturur commented Aug 8, 2021

Sorry you have to fix tests too, because the tests are based on the old weird values

@asturur
Copy link
Member

asturur commented Aug 8, 2021

Do you know how to run tests?

@stale
Copy link

stale bot commented Aug 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Aug 22, 2021
@stale stale bot removed the stale Issue marked as stale by the stale bot label Aug 26, 2021
@asturur
Copy link
Member

asturur commented Aug 27, 2021

i will fix tests in a following pr to correctly credit @meetwhere-dev

@asturur asturur merged commit b958990 into fabricjs:master Aug 27, 2021
@asturur
Copy link
Member

asturur commented Aug 27, 2021

before:

0
VM139:1 0.01
VM139:1 0.02
VM139:1 0.03
VM139:1 0.04
VM139:1 0.05
VM139:1 0.060000000000000005
VM139:1 0.07
VM139:1 0.08
VM139:1 0.09
VM139:1 0.09999999999999999
VM139:1 0.10999999999999999
VM139:1 0.11999999999999998
VM139:1 0.12999999999999998
VM139:1 0.13999999999999999
VM139:1 0.15
VM139:1 0.16
VM139:1 0.17
VM139:1 0.18000000000000002
VM139:1 0.19000000000000003
VM139:1 0.20000000000000004
VM139:1 0.21000000000000005
VM139:1 0.22000000000000006
VM139:1 0.23000000000000007
VM139:1 0.24000000000000007
VM139:1 0.25000000000000006
VM139:1 0.26000000000000006
VM139:1 0.2700000000000001
VM139:1 0.2800000000000001
VM139:1 0.2900000000000001
VM139:1 0.3000000000000001
VM139:1 0.3100000000000001
VM139:1 0.3200000000000001
VM139:1 0.3300000000000001
VM139:1 0.34000000000000014
VM139:1 0.35000000000000014
VM139:1 0.36000000000000015
VM139:1 0.37000000000000016
VM139:1 0.38000000000000017
VM139:1 0.3900000000000002
VM139:1 0.4000000000000002
VM139:1 0.4100000000000002
VM139:1 0.4200000000000002
VM139:1 0.4300000000000002
VM139:1 0.4400000000000002
VM139:1 0.45000000000000023
VM139:1 0.46000000000000024
VM139:1 0.47000000000000025
VM139:1 0.48000000000000026
VM139:1 0.49000000000000027
VM139:1 0.5000000000000002
VM139:1 0.5100000000000002
VM139:1 0.5200000000000002
VM139:1 0.5300000000000002
VM139:1 0.5400000000000003
VM139:1 0.5500000000000003
VM139:1 0.5600000000000003
VM139:1 0.5700000000000003
VM139:1 0.5800000000000003
VM139:1 0.5900000000000003
VM139:1 0.6000000000000003
VM139:1 0.6100000000000003
VM139:1 0.6200000000000003
VM139:1 0.6300000000000003
VM139:1 0.6400000000000003
VM139:1 0.6500000000000004
VM139:1 0.6600000000000004
VM139:1 0.6700000000000004
VM139:1 0.6800000000000004
VM139:1 0.6900000000000004
VM139:1 0.7000000000000004
VM139:1 0.7100000000000004
VM139:1 0.7200000000000004
VM139:1 0.7300000000000004
VM139:1 0.7400000000000004
VM139:1 0.7500000000000004
VM139:1 0.7600000000000005
VM139:1 0.7700000000000005
VM139:1 0.7800000000000005
VM139:1 0.7900000000000005
VM139:1 0.8000000000000005
VM139:1 0.8100000000000005
VM139:1 0.8200000000000005
VM139:1 0.8300000000000005
VM139:1 0.8400000000000005
VM139:1 0.8500000000000005
VM139:1 0.8600000000000005
VM139:1 0.8700000000000006
VM139:1 0.8800000000000006
VM139:1 0.8900000000000006
VM139:1 0.9000000000000006
VM139:1 0.9100000000000006
VM139:1 0.9200000000000006
VM139:1 0.9300000000000006
VM139:1 0.9400000000000006
VM139:1 0.9500000000000006
VM139:1 0.9600000000000006
VM139:1 0.9700000000000006
VM139:1 0.9800000000000006
VM139:1 0.9900000000000007

after:

0
VM187:1 0.01
VM187:1 0.02
VM187:1 0.03
VM187:1 0.04
VM187:1 0.05
VM187:1 0.06
VM187:1 0.07
VM187:1 0.08
VM187:1 0.09
VM187:1 0.1
VM187:1 0.11
VM187:1 0.12
VM187:1 0.13
VM187:1 0.14
VM187:1 0.15
VM187:1 0.16
VM187:1 0.17
VM187:1 0.18
VM187:1 0.19
VM187:1 0.2
VM187:1 0.21
VM187:1 0.22
VM187:1 0.23
VM187:1 0.24
VM187:1 0.25
VM187:1 0.26
VM187:1 0.27
VM187:1 0.28
VM187:1 0.29
VM187:1 0.3
VM187:1 0.31
VM187:1 0.32
VM187:1 0.33
VM187:1 0.34
VM187:1 0.35
VM187:1 0.36
VM187:1 0.37
VM187:1 0.38
VM187:1 0.39
VM187:1 0.4
VM187:1 0.41
VM187:1 0.42
VM187:1 0.43
VM187:1 0.44
VM187:1 0.45
VM187:1 0.46
VM187:1 0.47
VM187:1 0.48
VM187:1 0.49
VM187:1 0.5
VM187:1 0.51
VM187:1 0.52
VM187:1 0.53
VM187:1 0.54
VM187:1 0.55
VM187:1 0.56
VM187:1 0.57
VM187:1 0.58
VM187:1 0.59
VM187:1 0.6
VM187:1 0.61
VM187:1 0.62
VM187:1 0.63
VM187:1 0.64
VM187:1 0.65
VM187:1 0.66
VM187:1 0.67
VM187:1 0.68
VM187:1 0.69
VM187:1 0.7
VM187:1 0.71
VM187:1 0.72
VM187:1 0.73
VM187:1 0.74
VM187:1 0.75
VM187:1 0.76
VM187:1 0.77
VM187:1 0.78
VM187:1 0.79
VM187:1 0.8
VM187:1 0.81
VM187:1 0.82
VM187:1 0.83
VM187:1 0.84
VM187:1 0.85
VM187:1 0.86
VM187:1 0.87
VM187:1 0.88
VM187:1 0.89
VM187:1 0.9
VM187:1 0.91
VM187:1 0.92
VM187:1 0.93
VM187:1 0.94
VM187:1 0.95
VM187:1 0.96
VM187:1 0.97
VM187:1 0.98
VM187:1 0.99

@asturur asturur mentioned this pull request Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants