Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

From Discord: Error using fast-check with Arbitrary created by schema: Seeking resolution and guidance #484

Closed
effect-bot opened this issue Oct 15, 2023 · 0 comments · Fixed by #486
Assignees
Labels
bug-confirmed Bug report that is confirmed

Comments

@effect-bot
Copy link

Summary

The user is encountering an error when using fast-check with an Arbitrary created by a schema. The error specifically mentions that the fc.float constraint requires a 32-bit float and suggests using Math.fround(myDouble) to convert a double to a 32-bit float. The user provided a schema for an Ease type, which includes a clamp constraint on a number range. They also mentioned trying to use Math.fround on the min and max values, but the error persisted.

Key takeaways:

  • The error is related to the fc.float constraint and the requirement for a 32-bit float.
  • The user has a schema for an Ease type with a clamp constraint on a number range.
  • The error occurred regardless of using Math.fround on the min and max values.
  • The error message suggests using Math.fround to convert a double to a 32-bit float.

Discord thread

https://discord.com/channels/795981131316985866/1163050628386390169

@gcanti gcanti added the bug-confirmed Bug report that is confirmed label Oct 15, 2023
@gcanti gcanti self-assigned this Oct 15, 2023
gcanti added a commit that referenced this issue Oct 15, 2023
…udience of inexperienced developers (without mention it). Also follow these rules: 1. when a code fence is empty do not insert code 2. when you encounter a "TODO" expand on that 3. when a section is too succint, expand the text and add an introduction 4. do not change too much the text, just rewrite with better english 5: if you see a command like "CHATGPT: <text>" execute the command after the main task MDX file: Arbitrary: use Math.fround when creating number constraints, closes #484
@gcanti gcanti closed this as completed in 0a20788 Oct 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug-confirmed Bug report that is confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants