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

[RFC 61] Add Modulo Operator (and floored division) #2997

Merged
merged 7 commits into from
Feb 7, 2019
Merged

Conversation

mfelsche
Copy link
Contributor

@mfelsche mfelsche commented Jan 30, 2019

Implementation of RFC 61.

This PR adds the following methods to the number classes hierarchy and adds the implementation to each stdlib implementation (U8, U16, ... I8, I16, ..., F32, F64):

Real

  • fld
  • mod

Integer

  • fld_unsafe

  • fld_partial

  • fldc

  • mod_unsafe

  • mod_partial

  • modc

FloatingPoint

  • fld_unsafe
  • mod_unsafe

mfelsche and others added 5 commits January 21, 2019 12:28
and the corresponding checked and partial variants for integers.
also add fldc, fld_unsafe, fld_partial and
modc, mod_unsafe, mod_partial
and add unsafe variants
@mfelsche mfelsche added do not merge This PR should not be merged at this time changelog - added Automatically add "Added" CHANGELOG entry on merge labels Jan 30, 2019
@mfelsche
Copy link
Contributor Author

Also i did not implement %% as compiler intrinsic as it was easier to implement in pony and afaik results in the same LLVM IR, thus same machine code.

Also, outside the scope of this RFC, but what about \ as operator for fld?

@mfelsche
Copy link
Contributor Author

Some properties mentioned in the RFC have been verified here (when run against ponyc built from this branch): https://github.com/mfelsche/stdlib-properties/blob/master/stdlib-properties/main.pony#L82-L100

@mfelsche mfelsche removed the do not merge This PR should not be merged at this time label Jan 31, 2019
@SeanTAllen
Copy link
Member

@mfelsche RFC includes updates to the tutorial. I don't want to merge this until that is also available as the tutorial changes were part of the RFC that was accepted.

@SeanTAllen SeanTAllen added the do not merge This PR should not be merged at this time label Feb 5, 2019
@mfelsche
Copy link
Contributor Author

mfelsche commented Feb 6, 2019

tutorial PR is here: ponylang/pony-tutorial#347

@SeanTAllen SeanTAllen removed the do not merge This PR should not be merged at this time label Feb 7, 2019
@SeanTAllen SeanTAllen merged commit 5da626b into master Feb 7, 2019
@SeanTAllen SeanTAllen deleted the rfc-61-mod branch February 7, 2019 17:48
ponylang-main added a commit that referenced this pull request Feb 7, 2019
@SeanTAllen SeanTAllen mentioned this pull request Feb 26, 2019
@Theodus Theodus mentioned this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - added Automatically add "Added" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants