From 740abea77882cca2ac9836246c65247996db9140 Mon Sep 17 00:00:00 2001 From: Manson Date: Tue, 10 Jun 2025 18:52:46 +0800 Subject: [PATCH] docs(animation): add MAX_SAFE_INTEGER warning for large input edge case (#3231) 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 4ee8362bb..6dbe46045 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 })