-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add Math.clamp #44
Comments
This comment was originally written by [email protected] Here's a patch with an implementation and tests. Attachment: |
This comment was originally written by [email protected] What should happen if lower >= upper? |
This comment was originally written by [email protected] Removed Type-Defect label. |
This comment was originally written by [email protected] It should probably throw an exception like the functions in Date do. Side note: should the docs for Expect.throws() mention the () => foo() syntax? I at least had to poke around for a bit to figure it out. Attachment: |
This comment was originally written by [email protected] Added Area-Language, Triaged labels. |
This comment was originally written by [email protected] It's probably worth noting here that this idea was received pretty warmly over on Reddit. http://www.reddit.com/r/programming/comments/l6uwv/dart_programming_language/c2q9sbc |
Removed Area-Language label. |
We are discussing the idea. Currently we are tending towards adding it to the num interface. Ex: |
This comment was originally written by [email protected] I don't see if lower = upper as an issue. Just return lower or upper, which is almost certainly what the programmer would want. If lower > upper, than it would make sence to which lower and upper around. Although this is probably the best thing to do hear in terms of the programmers intentions, this would degrade performance(no more than throwing an exception would however). |
This comment was originally written by [email protected] My vote agrees with Comment #8. Sorry if this is considered a "Me too".. I'd like the ability to just Star a comment. :-\ |
Also would be good to get nearlyEquals from goog.math: http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/math/math.js |
This comment was originally written by [email protected] @clamp_v2.diff "if (lower >= upper) throw new IllegalArgumentException();" That should be '>', not '>='. Using the same value for both is seemingly pointless, but it's not illegal. E.g. if you want that your 5 is at least 5 and at most 5, then, yes, you can have that totally five-y 5. It really isn't as stupid as it sounds, seriously. Imagine there is a range slider which doesn't enforce a minimum distance between both values and you just take those values and throw them at this clamp function. Would be nice if it would work, wouldn't it? Well, with "Math.max(Math.min(val, atLeast), atMost)" this works just fine. Naturally, it should work with a built-in clamp function, too. |
Set owner to @floitschG. |
Fixed in lib_v2, r14576. Added Fixed label. |
…ptor, webdev collection (https://github.com/dart-lang/collection/compare/414ffa1..ca45fc4): ca45fc4 2022-10-07 Devon Carew update CI config; prep for publishing (#251) glob (https://github.com/dart-lang/glob/compare/1d51fcc..ee81279): ee81279 2022-10-10 Moritz Merge pull request #62 from dart-lang/bump_deps b6747a1 2022-10-10 moritz Add changelog entry d069e13 2022-10-10 moritz Bump depencies intl (https://github.com/dart-lang/intl/compare/7639a15..dda8ade): dda8ade 2022-10-10 Moritz GitHub Sync (#501) markdown (https://github.com/dart-lang/markdown/compare/f387340..d72ae07): d72ae07 2022-10-07 Sam Rawlins Use fewer empty lists; non-growable (#463) stack_trace (https://github.com/dart-lang/stack_trace/compare/17f09c2..2194227): 2194227 2022-10-10 Kevin Moore A bunch of cleanup, prepare for v1.11.0 (#118) test_descriptor (https://github.com/dart-lang/test_descriptor/compare/f392f85..66f14ce): 66f14ce 2022-10-07 Devon Carew update the CI configuration; prep for publishing (#44) webdev (https://github.com/dart-lang/webdev/compare/7416956..69aac60): 69aac60 2022-10-07 Parker Lougheed Update min SDK restraint mentioned to match pubspec (#1755) b175072 2022-10-07 Elliott Brooks (she/her) Start migration of WebDev to null-safety (#1756) Change-Id: I452b89a44cfcb7b0d9f36eeb1539ea362b29b6b8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263521 Commit-Queue: Nate Bosch <[email protected]> Auto-Submit: Devon Carew <[email protected]> Reviewed-by: Nate Bosch <[email protected]>
…ev, boolean_selector_rev, browser_launcher_rev, characters_rev, cli_util_rev, clock_rev, collection_rev, convert_rev, crypto_rev, csslib_rev Revisions updated by `dart tools/rev_sdk_deps.dart`. args (https://github.com/dart-lang/args/compare/a23ea85..bd3ac85): bd3ac85 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#234) 86dacb3 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#233) async (https://github.com/dart-lang/async/compare/f700e9a..8deaa40): 8deaa40 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#234) b28604f 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#233) bazel_worker (https://github.com/dart-lang/bazel_worker/compare/b35c25e..1124692): 1124692 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#67) 1e57757 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#68) benchmark_harness (https://github.com/dart-lang/benchmark_harness/compare/76881df..b1efcf7): b1efcf7 2023-02-02 Devon Carew add a publishing workflow action to dart-lang/benchmark_harness (#81) 4e0c4e8 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#83) 010ea89 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#82) boolean_selector (https://github.com/dart-lang/boolean_selector/compare/ba7d86b..16e6ad3): 16e6ad3 2023-01-31 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#42) c8874cc 2023-01-31 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#43) browser_launcher (https://github.com/dart-lang/browser_launcher/compare/f2f01e4..bc2dc4e): bc2dc4e 2023-01-31 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#38) 00a57fa 2023-01-31 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#39) characters (https://github.com/dart-lang/characters/compare/4526aa8..29f3a3e): 29f3a3e 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#73) 6516030 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#74) cli_util (https://github.com/dart-lang/cli_util/compare/32bc077..fd38b5f): fd38b5f 2023-01-31 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#74) 166fbac 2023-01-31 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#75) clock (https://github.com/dart-lang/clock/compare/65e8a13..5abb481): 5abb481 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#43) 11b18ed 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#44) collection (https://github.com/dart-lang/collection/compare/a566328..0d0e184): 0d0e184 2023-02-01 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#268) d0897af 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#269) convert (https://github.com/dart-lang/convert/compare/20d136c..83886e3): 83886e3 2023-02-01 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#75) a522506 2023-01-31 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#74) crypto (https://github.com/dart-lang/crypto/compare/f854f2f..03eb2c9): 03eb2c9 2023-01-31 dependabot[bot] Bump actions/checkout from 3.2.0 to 3.3.0 (#139) b6d6b33 2023-01-31 dependabot[bot] Bump dart-lang/setup-dart from 1.3 to 1.4 (#140) csslib (https://github.com/dart-lang/csslib/compare/f33d632..e6c8308): e6c8308 2023-01-31 Devon Carew fix the reported span for expressions (#167) a190358 2023-01-31 Devon Carew add a repro for #136 (#160) fa3e221 2023-01-31 Devon Carew correct the logic in isPredefinedName (#166) Change-Id: I68bc236d4e0b5c31b5d629f2b89f82f56d30a28e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281260 Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Nate Bosch <[email protected]> Reviewed-by: Nate Bosch <[email protected]>
… dartdoc, html, term_glyph, test, webdev, yaml_edit Revisions updated by `dart tools/rev_sdk_deps.dart`. boolean_selector (https://github.com/dart-lang/boolean_selector/compare/28dc03d..9fd3bae): 9fd3bae 2023-04-04 dependabot[bot] Bump actions/checkout from 3.3.0 to 3.5.0 (#44) browser_launcher (https://github.com/dart-lang/browser_launcher/compare/ba4e028..ed11524): ed11524 2023-04-04 dependabot[bot] Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#40) clock (https://github.com/dart-lang/clock/compare/93d9f56..6b2004c): 6b2004c 2023-04-04 dependabot[bot] Bump actions/checkout from 3.3.0 to 3.5.0 (#47) crypto (https://github.com/dart-lang/crypto/compare/8a03816..1cb1528): 1cb1528 2023-04-04 dependabot[bot] Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#142) csslib (https://github.com/dart-lang/csslib/compare/5836863..44bfbe3): 44bfbe3 2023-04-04 dependabot[bot] Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#176) dartdoc (https://github.com/dart-lang/dartdoc/compare/1a7952b..a0755f5): a0755f5f 2023-04-04 Janice Collins Fix example modifiers (#3383) html (https://github.com/dart-lang/html/compare/57b747d..0438b26): 0438b26 2023-04-05 Oleh Prypin Dart 3 compatibility: turn classes into mixins (#208) term_glyph (https://github.com/dart-lang/term_glyph/compare/f6856e2..b110501): b110501 2023-04-04 dependabot[bot] Bump actions/checkout from 3.3.0 to 3.5.0 (#35) test (https://github.com/dart-lang/test/compare/8ea4298..7832931): 78329319 2023-04-04 Devon Carew regenerate mono_repo (#1988) webdev (https://github.com/dart-lang/webdev/compare/e887316..0a2804b): 0a2804bd 2023-04-04 Elliott Brooks Fix DevTools test (#2071) yaml_edit (https://github.com/dart-lang/yaml_edit/compare/386fd33..5f392a1): 5f392a1 2023-04-04 dependabot[bot] Bump actions/checkout from 3.3.0 to 3.5.0 (#48) Change-Id: Ib9ee434634d3116db7ada89a4c31a566a28b5600 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293744 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Devon Carew <[email protected]> Auto-Submit: Devon Carew <[email protected]>
…er, mime, mockito, native, path, test, watcher, webdev, yaml_edit Revisions updated by `dart tools/rev_sdk_deps.dart`. browser_launcher (https://github.com/dart-lang/browser_launcher/compare/ed11524..551e101): 551e101 2023-05-11 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#43) 29a57a0 2023-05-11 Elliott Brooks Disable test (#44) file (https://github.com/google/file.dart/compare/b905180..e90e5ed): e90e5ed 2023-05-11 Bernardo Ferrari Migrate to Dart 3 (#210) http (https://github.com/dart-lang/http/compare/db84d12..981b63b): 981b63b 2023-05-11 Brian Quinlan Support the NSURLSession WebSocket API (#921) leak_tracker (https://github.com/dart-lang/leak_tracker/compare/46a1fa0..bc7f604): bc7f604 2023-05-11 Polina Cherkasova Fix typo. (#61) logging (https://github.com/dart-lang/logging/compare/4779d7e..b75cba7): b75cba7 2023-05-10 Devon Carew blast_repo fixes (#137) matcher (https://github.com/dart-lang/matcher/compare/5890f2b..4dfd9ad): 4dfd9ad 2023-05-10 dependabot[bot] Bump actions/checkout from 3.5.0 to 3.5.2 (#218) mime (https://github.com/dart-lang/mime/compare/57fbf6e..eb9d54b): eb9d54b 2023-05-10 Devon Carew blast_repo fixes (#95) mockito (https://github.com/dart-lang/mockito/compare/56173fa..51a7728): 51a7728 2023-05-12 Copybara-Service Merge pull request #597 from danielgomezrico:feat/returnInOrder 7a93b61 2023-01-15 Daniel Gomez Rico Add `returnInOrder` to `Mock` 34da8da 2023-05-02 Nate Bosch Import `packge:matcher` directly instead of `test_api` native (https://github.com/dart-lang/native/compare/908e61f..64aa5b5): 64aa5b5 2023-05-12 Daco Harkes [native_assets_cli] Add `outDirName` (#38) fdcd0eb 2023-05-09 Devon Carew contribute a PR labeler (#37) d44eae5 2023-05-08 Daco Harkes Give tests on MacOS more time (#36) 3b39e07 2023-05-04 Daco Harkes [c_compiler] Make `logger` required (#35) path (https://github.com/dart-lang/path/compare/1552cfd..f8d15c2): f8d15c2 2023-05-10 Devon Carew blast_repo fixes (#144) test (https://github.com/dart-lang/test/compare/0b306dd..931410c): 931410c8 2023-05-10 Nate Bosch Fix CI (#2014) watcher (https://github.com/dart-lang/watcher/compare/9430592..1584936): 1584936 2023-05-12 Brian Quinlan Update to 1.1.0 in preparation for release. (#145) webdev (https://github.com/dart-lang/webdev/compare/469b105..60616ba): 60616bac 2023-05-10 Elliott Brooks Syntax error in DCM workflow file(#2108) yaml_edit (https://github.com/dart-lang/yaml_edit/compare/763ca94..87dcf31): 87dcf31 2023-05-10 Devon Carew blast_repo fixes (#53) Change-Id: I4d25e4ccb60a86a6b5f8a66cfc6ae09f6df0a954 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303005 Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
…est_process, tools, webdev Revisions updated by `dart tools/rev_sdk_deps.dart`. convert (https://github.com/dart-lang/convert/compare/b652c00..9a387f0): 9a387f0 2023-05-16 Devon Carew blast_repo fixes (#83) dartdoc (https://github.com/dart-lang/dartdoc/compare/2952f6b..702f3ff): 702f3ff7 2023-05-16 Devon Carew Update dependabot.yaml (#3415) http (https://github.com/dart-lang/http/compare/981b63b..fb3b4be): fb3b4be 2023-05-16 Brian Quinlan Revert "Support the NSURLSession WebSocket API (#921)" (#931) mockito (https://github.com/dart-lang/mockito/compare/51a7728..3fadd2d): 3fadd2d 2023-05-17 Ilya Yanok Let users provide dummy values for types b14d571 2023-05-15 Googler Fix for InvalidType native (https://github.com/dart-lang/native/compare/e01aa63..3d89166): 3d89166 2023-05-16 Daco Harkes Add iOS x64 back (#41) protobuf (https://github.com/dart-lang/protobuf/compare/05058a7..038872b): 038872b 2023-05-16 Oleh Prypin Remove implementation of `hashCode` because it makes enum values non-const in Dart 3 (#831) test (https://github.com/dart-lang/test/compare/8e444df..cdedf40): cdedf40c 2023-05-16 Nate Bosch Prepare to publish (#2016) test_process (https://github.com/dart-lang/test_process/compare/b6a6cd5..d7a1711): d7a1711 2023-05-16 Nate Bosch Prepare to publish (#44) tools (https://github.com/dart-lang/tools/compare/62c9604..49da4ca): 49da4ca 2023-05-12 Polina Cherkasova Add memory events. (#92) webdev (https://github.com/dart-lang/webdev/compare/60616ba..2b2ae0e): 2b2ae0e8 2023-05-15 Elliott Brooks Try to fix dependabot PRs (#2112) d19dafe0 2023-05-15 Elliott Brooks Manual update deps (#2113) c0eb1069 2023-05-15 Elliott Brooks Disable tests using webdriver (#2115) a16bc9f2 2023-05-15 Elliott Brooks Dart Debug Extension builder fix (#2117) Change-Id: Icd714c5d54cd3aee999e4ae3cc3a97928dc1a821 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304120 Commit-Queue: Devon Carew <[email protected]> Auto-Submit: Devon Carew <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
…wn, mockito, native, pool, pub_semver, shelf, sse, stack_trace, stream_channel, string_scanner, term_glyph, test, test_reflective_loader, tools Revisions updated by `dart tools/rev_sdk_deps.dart`. clock (https://github.com/dart-lang/clock/compare/fe85908..21caac1): 21caac1 2023-05-21 Kevin Moore Update formatting (#52) collection (https://github.com/dart-lang/collection/compare/db2da48..f949b09): f949b09 2023-05-18 Graciliano Monteiro Passos `CanonicalizedMap`: new `copy`, `toMap` and `toMapOfCanonicalKeys` methods (#261) file (https://github.com/google/file.dart/compare/f05f5db..5d9a602): 5d9a602 2023-05-19 Jacob MacDonald remove no longer necessary override (#223) e4eebba 2023-05-19 Jacob MacDonald release version 7.0.0 (#222) glob (https://github.com/dart-lang/glob/compare/30f6aba..109121d): 109121d 2023-05-19 Jacob MacDonald allow latest file, update to latest dart_flutter_team_lints (#78) json_rpc_2 (https://github.com/dart-lang/json_rpc_2/compare/800843e..b2ed6bd): b2ed6bd 2023-05-22 Devon Carew blast_repo fixes (#97) logging (https://github.com/dart-lang/logging/compare/fa2486d..7ba155a): 7ba155a 2023-05-22 Devon Carew blast_repo fixes (#141) markdown (https://github.com/dart-lang/markdown/compare/b951454..bd6ae8d): bd6ae8d 2023-05-22 Zhiguang Chen Table should be able to interrupt other blocks (#545) 0bc9d0e 2023-05-21 Devon Carew blast_repo fixes (#544) mockito (https://github.com/dart-lang/mockito/compare/28f174f..7c6d309): 7c6d309 2023-05-18 Devon Carew blast_repo fixes 2c1b429 2023-05-19 Ilya Yanok Extend using run-time dummy values to Futures native (https://github.com/dart-lang/native/compare/3d89166..00832c9): 00832c9 2023-05-22 Daco Harkes [c_compiler] Increase test timeout on Windows (#47) 06408e7 2023-05-22 Daco Harkes [native_assets_cli] Fix example repostory url (#42) c614277 2023-05-19 dependabot[bot] Bump nttld/setup-ndk (#45) 67a2d20 2023-05-19 dependabot[bot] Bump actions/labeler from 4.0.2 to 4.0.3 (#44) 270700e 2023-05-18 Devon Carew blast_repo fixes (#43) pool (https://github.com/dart-lang/pool/compare/86b4f43..a10a0f9): a10a0f9 2023-05-22 Devon Carew blast_repo fixes (#69) pub_semver (https://github.com/dart-lang/pub_semver/compare/6dd1908..c034352): c034352 2023-05-22 Devon Carew blast_repo fixes (#87) shelf (https://github.com/dart-lang/shelf/compare/8793687..e7bab95): e7bab95 2023-05-19 Devon Carew blast_repo fixes (#356) sse (https://github.com/dart-lang/sse/compare/11ba89e..bfcbcd7): bfcbcd7 2023-05-19 Devon Carew blast_repo fixes (#84) stack_trace (https://github.com/dart-lang/stack_trace/compare/36fa0e1..86f7e30): 86f7e30 2023-05-19 Devon Carew blast_repo fixes (#132) stream_channel (https://github.com/dart-lang/stream_channel/compare/a862e41..b1d3384): b1d3384 2023-05-19 Devon Carew blast_repo fixes (#91) string_scanner (https://github.com/dart-lang/string_scanner/compare/3bc6e54..6bb314f): 6bb314f 2023-05-19 Devon Carew blast_repo fixes (#58) term_glyph (https://github.com/dart-lang/term_glyph/compare/3de5f1b..9d8956f): 9d8956f 2023-05-19 Devon Carew blast_repo fixes (#38) test (https://github.com/dart-lang/test/compare/cdedf40..309596e): 309596e4 2023-05-22 Devon Carew blast_repo fixes (#2019) test_reflective_loader (https://github.com/dart-lang/test_reflective_loader/compare/d1b763f..40d61b1): 40d61b1 2023-05-19 Devon Carew blast_repo fixes (#49) tools (https://github.com/dart-lang/tools/compare/49da4ca..0eb4141): 0eb4141 2023-05-18 Elias Yishak Update usage guide for onboarding users (#90) Change-Id: Id462318b1ea33bb1a6dea3c426d5306048a2cceb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304765 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Auto-Submit: Devon Carew <[email protected]>
…, convert, crypto, csslib, ecosystem, ffi, file, fixnum, html, http, lints, logging, markdown, matcher, mime, native, path, pool, protobuf, pub_semver, shelf, source_map_stack_trace, source_maps, source_span, sse, stack_trace, stream_channel, string_scanner, term_glyph, test_descriptor, test_process, test_reflective_loader, tools, typed_data, watcher, web_socket_channel, webdriver, webkit_inspection_protocol, yaml, yaml_edit Revisions updated by `dart tools/rev_sdk_deps.dart`. async (https://github.com/dart-lang/async/compare/def4482..9924570): 9924570 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#255) 61cdb0f 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#254) boolean_selector (https://github.com/dart-lang/boolean_selector/compare/479e1c1..7f523c3): 7f523c3 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#53) 1ed2941 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#54) browser_launcher (https://github.com/dart-lang/browser_launcher/compare/c2871b2..4f9e784): 4f9e784 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#51) 706c031 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#52) cli_util (https://github.com/dart-lang/cli_util/compare/56c1235..500dffa): 500dffa 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#91) c66e201 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#92) clock (https://github.com/dart-lang/clock/compare/200a020..f975668): f975668 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#59) eb5d2f5 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#58) convert (https://github.com/dart-lang/convert/compare/03242b2..f24afa7): f24afa7 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#89) a3e9bc5 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#90) crypto (https://github.com/dart-lang/crypto/compare/36ead7c..f3e64d2): f3e64d2 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#155) 7a7b517 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#156) csslib (https://github.com/dart-lang/csslib/compare/f6b68dd..17346e5): 17346e5 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#191) 4bdc553 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#192) ecosystem (https://github.com/dart-lang/ecosystem/compare/4acfcaf..dda7886): dda7886 2023-11-01 dependabot[bot] Bump peter-evans/create-or-update-comment (#192) b681c56 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#193) 0d768d4 2023-11-01 dependabot[bot] Bump subosito/flutter-action from 2.10.0 to 2.12.0 (#190) 178d244 2023-11-01 dependabot[bot] Bump actions/github-script (#194) 4b3e572 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#191) ffi (https://github.com/dart-lang/ffi/compare/2faec28..c926657): c926657 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#219) 3181ec0 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#220) file (https://github.com/google/file.dart/compare/7418131..e7c03aa): e7c03aa 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.0 to 1.6.0 (#233) fixnum (https://github.com/dart-lang/fixnum/compare/ef45eb5..3279f5d): 3279f5d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#120) 4913894 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#121) html (https://github.com/dart-lang/html/compare/49e2c8e..06bc148): 06bc148 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#232) 2630607 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#233) http (https://github.com/dart-lang/http/compare/7240d0a..b9389fe): b9389fe 2023-11-01 dependabot[bot] Bump futureware-tech/simulator-action from 2 to 3 (#1037) d7c36ae 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#1038) lints (https://github.com/dart-lang/lints/compare/5c60f48..f58fd77): f58fd77 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#168) logging (https://github.com/dart-lang/logging/compare/642ed21..324a0b5): 324a0b5 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#150) e9b13b7 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#151) markdown (https://github.com/dart-lang/markdown/compare/4e2e970..efb73b3): efb73b3 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#561) 2e4a3bc 2023-11-01 dependabot[bot] Bump subosito/flutter-action from 2.10.0 to 2.11.0 (#559) 22e378b 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#560) matcher (https://github.com/dart-lang/matcher/compare/7512f80..3d03fa1): 3d03fa1 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#231) b7d24c8 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#232) mime (https://github.com/dart-lang/mime/compare/af3e5fe..8ebf946): 8ebf946 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#108) 4328d32 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#107) native (https://github.com/dart-lang/native/compare/279094d..de9d59e): de9d59e 2023-11-01 Daco Harkes [infra] Fix PR publisher comments (#177) 22b6b24 2023-11-01 Daco Harkes [infra] Rename `dart.yaml` to `native.yaml` (#176) cc42fb1 2023-11-01 Daco Harkes [native_toolchain_c] Use sysroot on Android (#180) 01d92b0 2023-11-01 Daco Harkes [native_toolchain_c] Bump highest tested NDK version to 34 (#182) 53facde 2023-11-01 Daco Harkes [native_toolchain_c] Fix NDK discovery (#179) 285ee6c 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#174) 46a05e4 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#172) 23187fe 2023-11-01 dependabot[bot] Bump nttld/setup-ndk from 1.3.1 to 1.4.1 (#173) path (https://github.com/dart-lang/path/compare/4ca27d4..18ec71f): 18ec71f 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#153) f26c20c 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#154) pool (https://github.com/dart-lang/pool/compare/5ccef15..c78cef4): c78cef4 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#76) protobuf (https://github.com/dart-lang/protobuf/compare/3f567b2..dcec2ed): dcec2ed 2023-10-31 Ömer Sinan Ağacan Annotate deepCopy with @useResult (#897) pub_semver (https://github.com/dart-lang/pub_semver/compare/8e5a58f..f9e94ee): f9e94ee 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#95) 81fdbcf 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#94) shelf (https://github.com/dart-lang/shelf/compare/c15fc6f..b3adc7c): b3adc7c 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#391) baea52d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#392) source_map_stack_trace (https://github.com/dart-lang/source_map_stack_trace/compare/73d449c..2209626): 2209626 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#45) bfa3949 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#44) source_maps (https://github.com/dart-lang/source_maps/compare/fc6aa16..87dc587): 87dc587 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#84) 33ba11d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#85) source_span (https://github.com/dart-lang/source_span/compare/92e50bf..ed16e0d): ed16e0d 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#105) aacd748 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#104) sse (https://github.com/dart-lang/sse/compare/37df57d..8ddb95f): 8ddb95f 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#95) 8830125 2023-11-01 dependabot[bot] Bump nanasess/setup-chromedriver from 2.2.0 to 2.2.1 (#94) 86dd8f9 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#93) stack_trace (https://github.com/dart-lang/stack_trace/compare/634589f..6496ff8): 6496ff8 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#145) 3d60304 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#144) stream_channel (https://github.com/dart-lang/stream_channel/compare/ffdb208..178104d): 178104d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#98) 1193387 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#97) string_scanner (https://github.com/dart-lang/string_scanner/compare/9c525f7..a7105ef): a7105ef 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#65) f33ca6f 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#66) term_glyph (https://github.com/dart-lang/term_glyph/compare/cff80de..7c1eb9d): 7c1eb9d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#45) 39073ca 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#44) test_descriptor (https://github.com/dart-lang/test_descriptor/compare/55b5eac..c417cbb): c417cbb 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#59) dcfde39 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#58) test_process (https://github.com/dart-lang/test_process/compare/d610333..c21e40d): c21e40d 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#51) bfd0576 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#50) test_reflective_loader (https://github.com/dart-lang/test_reflective_loader/compare/8593eb1..17d40bb): 17d40bb 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#54) e664092 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#55) tools (https://github.com/dart-lang/tools/compare/01c0b52..dd91cb6): dd91cb6 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#192) 603b012 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#191) typed_data (https://github.com/dart-lang/typed_data/compare/d1c15ed..0b16bd2): 0b16bd2 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#76) f869102 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#77) watcher (https://github.com/dart-lang/watcher/compare/6ad58dc..b2b278a): b2b278a 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#154) 97e9637 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#155) web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/f3ac1bf..82ac73f): 82ac73f 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#289) 3615850 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#290) webdriver (https://github.com/google/webdriver.dart/compare/eaf9c58..43ed1db): 43ed1db 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#289) 02fd658 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#288) 8828360 2023-11-01 dependabot[bot] Bump nanasess/setup-chromedriver from 2.2.0 to 2.2.1 (#287) webkit_inspection_protocol (https://github.com/google/webkit_inspection_protocol.dart/compare/82f0c1c..2c6f8b6): 2c6f8b6 2023-11-01 dependabot[bot] Bump actions/checkout from 3.6.0 to 4.1.1 (#114) d4e4d55 2023-11-01 dependabot[bot] Bump nanasess/setup-chromedriver from 2.2.0 to 2.2.1 (#115) yaml (https://github.com/dart-lang/yaml/compare/9f0d649..98a3aab): 98a3aab 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#154) b63372b 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#155) yaml_edit (https://github.com/dart-lang/yaml_edit/compare/a7e7fba..9b9d33c): 9b9d33c 2023-11-01 dependabot[bot] Bump actions/checkout from 4.1.0 to 4.1.1 (#61) b71c2e8 2023-11-01 dependabot[bot] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#60) Change-Id: I8b663f536d4e80728c6570372d886edfef227cf1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333059 Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
This issue was originally filed by [email protected]
Please add a function to the Math class that clamps a value between a minimum and a maximum, like so:
a = Math.clamp( a, -1, 1 );
This would behave identically to:
a = Math.max( -1, Math.min( 1, a ) );
The text was updated successfully, but these errors were encountered: