Skip to content

Develop vector2、constants and scalar.#43

Open
YuanSang0512 wants to merge 2 commits intogkit-org:mainfrom
YuanSang0512:feature/math
Open

Develop vector2、constants and scalar.#43
YuanSang0512 wants to merge 2 commits intogkit-org:mainfrom
YuanSang0512:feature/math

Conversation

@YuanSang0512
Copy link
Copy Markdown

No description provided.

Comment thread include/gkit/math/scalar.hpp
Comment thread include/gkit/math/scalar.hpp Outdated
Comment thread include/gkit/math/vector2.hpp Outdated
float x = 0.f,
y = 0.f;

inline constexpr auto length() const -> float32 { return std::sqrt(x * x + y * y); }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msvc中,std::sqrt 是非 constexpr 函数。在gcc/llvm平台是constexpr的(但这并非标准cpp20标准,cpp23才支持正式的编译期 std::sqrt

Copy link
Copy Markdown
Contributor

@CoraBlack CoraBlack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

未通过的构建测试工作流

Comment thread include/gkit/math/vector2.hpp
@CoraBlack CoraBlack self-requested a review April 16, 2026 00:18
Comment thread include/gkit/math/constants.hpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants