Logo

index : gist

Random things

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/gist.git/html/jai/hot_reload/modules/0x2_Math.jai blob: 7469a269238f0e2db57128d2122313a5061444c4 [raw] [clear marker]

        
0
1
2
3roundf :: inline (x: float) -> float {
4 return floor(x + 0.5);
5}
6
7round :: inline (x: float) -> int {
8 return xx floor(x + 0.5);
9}
10
11
12#scope_file
13
14
15using, only(floor) Math :: #import "Math";
16
17
18/*
19------------------------------------------------------------------------------
20This software is available under 2 licenses -- choose whichever you prefer.
21------------------------------------------------------------------------------
22ALTERNATIVE A - MIT License
23Copyright (c) 2026 Adam Blazeowsky
24Permission is hereby granted, free of charge, to any person obtaining a copy of
25this software and associated documentation files (the "Software"), to deal in
26the Software without restriction, including without limitation the rights to
27use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28of the Software, and to permit persons to whom the Software is furnished to do
29so, subject to the following conditions:
30The above copyright notice and this permission notice shall be included in all
31copies or substantial portions of the Software.
32THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38SOFTWARE.
39------------------------------------------------------------------------------
40ALTERNATIVE B - Public Domain (www.unlicense.org)
41This is free and unencumbered software released into the public domain.
42Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
43software, either in source code form or as a compiled binary, for any purpose,
44commercial or non-commercial, and by any means.
45In jurisdictions that recognize copyright laws, the author or authors of this
46software dedicate any and all copyright interest in the software to the public
47domain. We make this dedication for the benefit of the public at large and to
48the detriment of our heirs and successors. We intend this dedication to be an
49overt act of relinquishment in perpetuity of all present and future rights to
50this software under copyright law.
51THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
55ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
56WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
57------------------------------------------------------------------------------
58*/
59
60
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit