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

Add floor/1 and ceil/1 #1145

Merged
merged 9 commits into from
Sep 5, 2016
Merged

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Aug 22, 2016

Add floor/1 and ceil/1 as new guard BIFs. They take numbers and return an integer. I have made them guard BIFs to make them first-class citizens in the same way as trunc/1 is a first-class citizen. See the discussion in #1084.

Also add math:floor/1 and math:ceil/1 that return floating point numbers. They are useful when the calls to floor or ceil is mixed with other floating point operations.

@bjorng bjorng added team:VM Assigned to OTP team VM team:MW feature labels Aug 22, 2016
@psyeugenic psyeugenic added kanban and removed team:VM Assigned to OTP team VM labels Aug 24, 2016
@psyeugenic psyeugenic removed their assignment Aug 31, 2016
IngelaAndin and others added 9 commits September 2, 2016 11:11
Avoid to run tests of algorithms not supported by crypto.
* rickard/new-purge-strategy/OTP-13777:
  Introduce literal sweep of native stack in new purge strategy
* maint:
  Introduce literal sweep of native stack in new purge strategy
Even though v2 is never supported v2 hellos can be.
No support for v2 client hellos gives "handshake failiure" alert.

Support for v2 hello but no higher SSL/TLS version offered
gives "protocol version" alert.
* ingela/ssl/test-framework-checks:
  ssl: Test ssl v2 clients rejection depending on configuration
  ssl: Add check in test framework for crypto support
Implement as ceil/1 and floor/1 as new guard BIFs (essentially part of
Erlang language). They are guard BIFs because trunc/1 is a guard
BIF. It would be strange to have trunc/1 as a part of the language, but
not ceil/1 and floor/1.
Add math:floor/1 and math:ceil/1 to avoid unnecessary conversions
in floating point expressions. That is, instead of having to write
float(floor(X)) as part of a floating point expressions, we can
write simply math:floor(X).
@bjorng bjorng force-pushed the bjorn/floor-ceiling/OTP-13692 branch from 60f3b28 to 6d40cfd Compare September 5, 2016 09:57
@bjorng bjorng merged commit 6d40cfd into erlang:master Sep 5, 2016
@bjorng bjorng deleted the bjorn/floor-ceiling/OTP-13692 branch September 5, 2016 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants