You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int can be used instead of floor, but it's a bit of a hack… if you add round/ceil IMHO you may as well add floor, too.
Until this is resolved I plan to work around the lack of ceil with cond (lt (int $x) $x) (int (add $x 1)) (int $x). Round could be emulated in a similar fashion (untested) cond (lt $x ((int $x) + 0.5)) (int $x) (add (int $x) 1).
The text was updated successfully, but these errors were encountered:
Ceil and Floor are frontends for the stdlib math functions. The Round
implementation is essentially the same thing except that the Go stdlib
doesn't include a Round implementation in a stable release yet. I've
included the Round function slated for Go 1.10.
Fixesgohugoio#3883
Ceil and Floor are frontends for the stdlib math functions. The Round
implementation is essentially the same thing except that the Go stdlib
doesn't include a Round implementation in a stable release yet. I've
included the Round function slated for Go 1.10.
Fixes#3883
Title is pretty self-explanatory.
int
can be used instead offloor
, but it's a bit of a hack… if you addround
/ceil
IMHO you may as well addfloor
, too.Until this is resolved I plan to work around the lack of
ceil
withcond (lt (int $x) $x) (int (add $x 1)) (int $x)
. Round could be emulated in a similar fashion (untested)cond (lt $x ((int $x) + 0.5)) (int $x) (add (int $x) 1)
.The text was updated successfully, but these errors were encountered: