Open
Conversation
ninjanomnom
commented
Nov 13, 2017

Techhead0
reviewed
Nov 13, 2017
dm/util.dm
Outdated
| #define ceil(x) (-round(-(x))) | ||
| #define floor(x) round(x) | ||
| #define clamp(x, low, high) max((low),min((high),(x))) | ||
| #define PI 3.1415 |
dm/util.dm
Outdated
| #define PI 3.1415 | ||
| #define SPEED_OF_LIGHT 3e8 //not exact but hey! | ||
| #define SPEED_OF_LIGHT_SQ 9e+16 | ||
| #define INFINITY 1e31 //closer then enough |
There was a problem hiding this comment.
You can actually define this as 1.#INF instead.
Author
There was a problem hiding this comment.
inf has some odd properties, people can use it directly if they want but most uses at least in ss13 code is just "very large number"
dm/util.dm
Outdated
|
|
||
| #define ISEVEN(x) (x % 2 == 0) | ||
|
|
||
| #define ISODD(x) (!ISEVEN(x)) |
Author
There was a problem hiding this comment.
I mean, it is odd. I just remembered I need to make this use actual modulo though for decimals to work
dm/util.dm
Outdated
| #define ROOT(n, x) (x ** (1 / n)) | ||
|
|
||
| // secant | ||
| #define SEC(x) (1 / cos(x)) |
There was a problem hiding this comment.
Should probably be grouped with COT and CSC.
50180ae to
9d80818
Compare
Author
|
once the sibling pr for this is merged on tg I'll update this to fix some oddities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.