Hacker Newsnew | past | comments | ask | show | jobs | submit | 4Data's commentslogin

Hmm, pretty sure floor rounds a number downward to its nearest integer. So Math.floor(-15.5) would be 15.

https://developer.mozilla.org/pt-PT/docs/Web/JavaScript/Refe...


Literally the first example on that page:

> Math.floor( 45.95); // 45

> Math.floor(-45.95); // -46

Its not like its hidden or anything... Its in the center of the page on my 1920x1080 screen.


Nope. Math.floor(-15.5) would be -16. It rounds a number downwards. -16 < -15.


Can you give an example of a pendulum swinging upwards? Is that an inverted pendulum? [1]

[1] https://www.youtube.com/watch?v=5oGYCxkgnHQ


Yes, that's a good example. The recipe I used for such demos was based on an old Soviet electric shaver and a standard bicycle wheel spoke, it's a known combination to get an inverted pendulum (even at funny angles, not necessarily entirely upward).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: