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

typia.random<T>() function generates invalid value when both uint and exclusiveMiinium be configured. #1289

Closed
samchon opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@samchon
Copy link
Owner

samchon commented Sep 20, 2024

When configure uint32 or uint64 type and define exclusiveMinimum tag, typia.random<T>() ignores the exclusive option.

import typia, { tags } from "typia";

console.log(
  new Array(100)
    .fill(0)
    .map(
      typia.createRandom<
        number &
          tags.Type<"uint32"> &
          tags.ExclusiveMinimum<0> &
          tags.ExclusiveMaximum<5>
      >(),
    ),
);
// 0 and 5 values are generated
@samchon samchon added the bug Something isn't working label Sep 20, 2024
@samchon samchon self-assigned this Sep 20, 2024
samchon added a commit that referenced this issue Sep 20, 2024
Fix #1289: `typia.random<T>()` function for `uint` and `exlusiveMinimum`.
@github-project-automation github-project-automation bot moved this from To do to Done in Typia v6 Update Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant