From be5a7d10a381671d047048367303f50037a2f90f Mon Sep 17 00:00:00 2001 From: Manson Date: Thu, 1 May 2025 20:01:07 +0800 Subject: [PATCH] docs(animation): add note about Number.MAX_SAFE_INTEGER for large input edge case --- src/guide/extras/animation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/guide/extras/animation.md b/src/guide/extras/animation.md index b70c558106..7d5faa9f0f 100644 --- a/src/guide/extras/animation.md +++ b/src/guide/extras/animation.md @@ -160,6 +160,8 @@ const tweened = reactive({ number: 0 }) +// Note: For inputs greater than Number.MAX_SAFE_INTEGER (9007199254740991), +// the result may be inaccurate due to limitations in JavaScript number precision. watch(number, (n) => { gsap.to(tweened, { duration: 0.5, number: Number(n) || 0 }) }) @@ -183,6 +185,8 @@ export default { tweened: 0 } }, + // Note: For inputs greater than Number.MAX_SAFE_INTEGER (9007199254740991), + // the result may be inaccurate due to limitations in JavaScript number precision. watch: { number(n) { gsap.to(this, { duration: 0.5, tweened: Number(n) || 0 })