News for hackers. Stuff that matters.
Re:Asteroid lost 1M kilograms after collision with DART spac... by chungy on Thursday March 02, 2023 @06:06AM (#34994407)
If you run Linux and have the `units` program installed, you can even do it without reaching for a web page:

  $ units '1-(11hr+22min)/(11hr+55min)'                                                                                                 
          Definition: 0.046153846
Re:Asteroid lost 1M kilograms after collision with DART spac... by willyt on Thursday March 02, 2023 @06:31AM (#34994535)
Just tried this on macOS but it must be a different 'units' command as it won't accept that input. :-(

However I just discovered that if you hit command spacebar and paste that into the spotlight search it gives the right answer! Spotlight has always done simple unit conversions but it didn't used to be able to do calculations with units in them. I wonder when that was introduced...

Re:Asteroid lost 1M kilograms after collision with DART spac... by dredmorbius on Thursday March 02, 2023 @06:48AM (#34994640)
MacOS's default units(1) is the BSD version.

GNU Units is far more featureful (and useful IMO).

You can install that, as "gunits", using Homebrew.

Re:Asteroid lost 1M kilograms after collision with DART spac... by tstrimple on Thursday March 02, 2023 @10:08AM (#34996566)
Most of the time I can get away with pretending MacOS is just sitting on top of Linux, but occasionally the BSD differences pop up and bite me.
Re:Asteroid lost 1M kilograms after collision with DART spac... by sirtomato on Thursday March 02, 2023 @10:36AM (#34996954)
GNU/Linux, or as I've recently been taking to calling it, GNU plus Linux
Re:Asteroid lost 1M kilograms after collision with DART spac... by BigJ1211 on Thursday March 02, 2023 @10:17AM (#34996691)
There is no gunits formula on homebrew, the formula is called gnu-units.

The command to use it is `gunits` though.

Re:Asteroid lost 1M kilograms after collision with DART spac... by dredmorbius on Thursday March 02, 2023 @06:02PM (#35003322)
Given that I invoke GNU Units far more often than I install it, yes, I referred to the command name.

It's trivial to find the actual package name using 'brew list | grep units'.

See note 2: <https://news.ycombinator.com/item?id=31449413>

Re:Asteroid lost 1M kilograms after collision with DART spac... by vultour on Thursday March 02, 2023 @06:29AM (#34994527)
Or you can just convert it into minutes...
Re:Asteroid lost 1M kilograms after collision with DART spac... by DangerousPie on Thursday March 02, 2023 @07:01AM (#34994717)
I suspect a lot more people here will have access to a browser than to a Linux shell with a specific tool installed.
Re:Asteroid lost 1M kilograms after collision with DART spac... by sva_ on Thursday March 02, 2023 @09:51AM (#34996335)
A lot of us always have a shell open on the side (we are dozens!!), so it's nice to learn about such tricks.
Re:Asteroid lost 1M kilograms after collision with DART spac... by xxs on Thursday March 02, 2023 @07:24AM (#34994845)
the Math is trivial - it's a bit more of a half an hour out of ~12h. That's bit more than 1/24 = ~4.5%.