Settings

Theme

Infinity and Negative Zero in Javascript

keeganj.com

2 points by keeganj 4 years ago · 2 comments

Reader

oblak 4 years ago

So, how does one get an -0 short of typing it?

  • keeganjOP 4 years ago

    I first ran into it when our database was holding negative values that we wanted to show as positive on the front end. To flip the sign we would multiply the stored value by -1. Since 0 was a valid value in our DB, the displayed value after multiplication was -0, which looked like a glitch in the UI.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection